# Create a javascript module for landing pages

**URL:** <https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [April 15, 2024, 10:22pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873 "2024-04-15T22:22:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTram](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TTram](https://community.hubspot.com/u/TTram)\
**Post date:** [April 15, 2024, 10:22pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/1 "2024-04-15T22:22:36Z")

</div>

Hi,

I have been given javScript code to add to a landing page that should create a live agent button. I follwed the steps to create a javascript file, but nothing apperars on the landing page when added. I am sure I am doing something wrong, but not sure what.

Any help is appericated. Thanks

> **[Create and add a JavaScript file to HubSpot](https://knowledge.hubspot.com/design-manager/add-a-javascript-file-to-hubspot)**
>
> Learn how to create a JavaScript file and add it to a template or page.

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [April 16, 2024, 12:47am UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/2 "2024-04-16T00:47:05Z")

</div>

Hi @TTram if you’ve added the javascript file to design manager, you would then need to call the script to load from the landing page via the landing page template or the Head HTML for the individual page.

---

<div class="post-metadata">

**Author:** ![TTram](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TTram](https://community.hubspot.com/u/TTram)\
**Post date:** [April 16, 2024, 5:25pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/3 "2024-04-16T17:25:53Z")

</div>

I have added the script public url to the landing page footer, should I be adding something else to the footer?

Thanks

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [April 17, 2024, 12:29am UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/4 "2024-04-17T00:29:48Z")

</div>

@TTram can you share a screenshot of how you have it added?

---

<div class="post-metadata">

**Author:** ![TTram](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TTram](https://community.hubspot.com/u/TTram)\
**Post date:** [April 18, 2024, 2:55pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/5 "2024-04-18T14:55:54Z")

</div>

This is the script I am trying to use and below is what I added to the landing footer. Thanks

 ![Screenshot 2024-04-18 095359.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/9/59f527dc823b446932d1cbb9444e578f72217bec.png)

 ![Screenshot 2024-04-17 151110.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/3/351910d7f2c25d59d319161e74e68c1e635e2e00.png)

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [April 18, 2024, 8:32pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/6 "2024-04-18T20:32:28Z")

</div>

@TTram when you open the page and inspect with the chrome dev console (right click \> inspect), are there any errors on the console tab?  
It might not work if you have it in both the Head and Footer HTML - it should be one or the other.

---

<div class="post-metadata">

**Author:** ![TTram](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@TTram](https://community.hubspot.com/u/TTram)\
**Post date:** [April 18, 2024, 10:45pm UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/7 "2024-04-18T22:45:30Z")

</div>

I do see errors in the console. Does that mean the scriprt will not work for the landing page module?

 ![Screenshot 2024-04-18 174457.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/a/ba6f7648c98e8eb12ab28ea6a0d524334a151fb3.png)

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [April 19, 2024, 1:23am UTC](https://community.hubspot.com/t/create-a-javascript-module-for-landing-pages/104873/8 "2024-04-19T01:23:42Z")

</div>

Hi @TTram yes, that’s correct - you would need to rewrite the javascript to not use inline execution.
