# Embed code for Form doesn't work

**URL:** <https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062>\
**Category:** Lead Capture Tools\
**Created:** [September 4, 2018, 1:40pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062 "2018-09-04T13:40:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacovm](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jacovm/32/25270_2.png) [@jacovm](https://community.hubspot.com/u/jacovm)\
**Post date:** [September 4, 2018, 1:40pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/1 "2018-09-04T13:40:40Z")

</div>

I created this form:

\<script charset=“utf-8” type=“text/javascript” src=“[//js.hsforms.net/forms/shell.js](https://js.hsforms.net/forms/shell.js)”\>\</script\>  
\<script\>  
hbspt.forms.create({  
portalId: “1837750”,  
formId: “40e957e2-0e67-4ec0-b903-c304fa532af6”  
});  
\</script\>

However, when trying to embed the form using HTML, it doesn’t seem to work and just shows a blank screen.

I tried using this website as well to test the code just in case, but it doesn’t work either.

> **[HTML And Script Code Tester](http://www.csgnetwork.com/htmlcodetest.html)**
>
> It calculates the capability of HTML code being tested for functional use. Cut and paste or type your HTML to be tested into the text box below.

The regular URL for this form does work however

> **[Form](https://share.hsforms.com/1QOlX4g5nTsC5A8ME-lMq9g13e0m)**

Any ideas what’s wrong with the embed code? I just copy/pasted it? Anyone else experiencing this?

Thanks

Jacov

---

<div class="post-metadata">

**Author:** ![trevordjones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trevordjones/32/35637_2.png) [@trevordjones](https://community.hubspot.com/u/trevordjones)\
**Post date:** [September 10, 2018, 1:02pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/2 "2018-09-10T13:02:54Z")

</div>

Hi @jacovm,

The only thing that seems to be missing from this forms code is the IE 8 compatability script, which should look something like this:

\<!--[if lte IE 8]\>  
\<script charset=“utf-8” type=“text/javascript” src=“[//js.hsforms.net/forms/shell-legacy.js](https://js.hsforms.net/forms/shell-legacy.js)”\>\</script\>  
\<![endif]--\>

The other possibility is that your website host is blocking the Javascript from functioning correctly, some hosts (including [WordPress.com](http://WordPress.com)) won’t allow Javascript to function.

If this doesn’t help, I’d suggest reaching out to your web host’s support group or HubSpot support for help.

Good Luck!

Trevor

---

<div class="post-metadata">

**Author:** ![jacovm](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jacovm/32/25270_2.png) [@jacovm](https://community.hubspot.com/u/jacovm)\
**Post date:** [September 13, 2018, 12:18pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/3 "2018-09-13T12:18:20Z")

</div>

Thanks @trevordjones

Yes, it did seem like an issue with the code on our website. Adding a \<div\> tag resolved this.

Thanks for the help.

Jacov

---

<div class="post-metadata">

**Author:** ![trevordjones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trevordjones/32/35637_2.png) [@trevordjones](https://community.hubspot.com/u/trevordjones)\
**Post date:** [September 13, 2018, 12:47pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/4 "2018-09-13T12:47:00Z")

</div>

Interesting to here that \<div\> tags helped. You might look at the other code on the page to see if there is a place where a you are missing a \</script\> tag.

---

<div class="post-metadata">

**Author:** ![tomshawver360md](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomshawver360md/32/31851_2.png) [@tomshawver360md](https://community.hubspot.com/u/tomshawver360md)\
**Post date:** [August 10, 2020, 8:13pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/5 "2020-08-10T20:13:51Z")

</div>

This solved it for me as well! To make forms work on Google Sites, just type

`<div>`

before the Hubspot embed code, and type

`</div>`

after the embed code. Boom, now it loads.

---

<div class="post-metadata">

**Author:** ![sharonlicari](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sharonlicari/32/101479_2.png) [@sharonlicari](https://community.hubspot.com/u/sharonlicari)\
**Post date:** [August 11, 2020, 1:56pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/6 "2020-08-11T13:56:31Z")

</div>

Thank you for sharing @tomshawver360md

---

<div class="post-metadata">

**Author:** ![icastrocr](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/icastrocr/32/44503_2.png) [@icastrocr](https://community.hubspot.com/u/icastrocr)\
**Post date:** [August 19, 2019, 11:29pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/7 "2019-08-19T23:29:51Z")

</div>

This worked like a charm for using Hubspot forms in the new Google Sites, and it took me a while to get here, so thank you a lot!

---

<div class="post-metadata">

**Author:** ![ACD](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/acd/32/2490_2.png) [@ACD](https://community.hubspot.com/u/ACD)\
**Post date:** [February 3, 2020, 11:56am UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/8 "2020-02-03T11:56:14Z")

</div>

Hi guys,

Sorry, I’m poor with coding. How exactly did you add the div code to the html to resolve this? I’m having an issue with the embeded code showing on my Google Sites.

---

<div class="post-metadata">

**Author:** ![julianalvarezk](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/julianalvarezk/32/44503_2.png) [@julianalvarezk](https://community.hubspot.com/u/julianalvarezk)\
**Post date:** [February 26, 2020, 4:54pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/9 "2020-02-26T16:54:13Z")

</div>

Hi @jacovm ,

I had the same issue, after hours of debbuging I’ve found that the HTML code is missing the HTTPS:, that’s why It didn’t work for me.

The actual code is:

\<script charset=“utf-8” type=“text/javascript” src=“https:[//js.hsforms.net/forms/shell.js](https://js.hsforms.net/forms/shell.js)”\>\</script\>  
\<script\>  
hbspt.forms.create({  
portalId: “1837750”,  
formId: “40e957e2-0e67-4ec0-b903-c304fa532af6”  
});  
\</script\>

Please tag this as a solution if It worked for You, I haven’t found this solution in any forum.

Greets.

---

<div class="post-metadata">

**Author:** ![fzubiran](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fzubiran/32/41549_2.png) [@fzubiran](https://community.hubspot.com/u/fzubiran)\
**Post date:** [April 21, 2020, 6:56pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/10 "2020-04-21T18:56:21Z")

</div>

I have de same problem it apears as a blank space, my actual code is:

\<script charset=“utf-8” type=“text/javascript” src=“[//js.hsforms.net/forms/shell.js](https://js.hsforms.net/forms/shell.js)”\>\</script\>

\<script\>

hbspt.forms.create({

portalId: “7462782”,

formId: “e71c7040-572b-4e7b-ad10-6b2c12edb69c”

});

\</script\>

what do i have to put in order to make it work

---

<div class="post-metadata">

**Author:** ![julianalvarezk](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/julianalvarezk/32/44503_2.png) [@julianalvarezk](https://community.hubspot.com/u/julianalvarezk)\
**Post date:** [April 21, 2020, 7:05pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/11 "2020-04-21T19:05:13Z")

</div>

Hi!

It seems to me that you have the same problem i did. Note that the src parameter is missing the protocol (HTTPS), that’s why the form wasn’t loading for me.

Try replacing your code with this:

\<script charset=“utf-8” type=“text/javascript” src="[https://js.hsforms.net/forms/shell.js"\>\</script](https://community.hubspot.com/)\>

\<script\>

hbspt.forms.create({

portalId: “7462782”,

formId: “e71c7040-572b-4e7b-ad10-6b2c12edb69c”

});

\</script\>

---

<div class="post-metadata">

**Author:** ![fzubiran](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fzubiran/32/41549_2.png) [@fzubiran](https://community.hubspot.com/u/fzubiran)\
**Post date:** [April 22, 2020, 9:24pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/12 "2020-04-22T21:24:42Z")

</div>

thanks for the tip it still doesn’t work

---

<div class="post-metadata">

**Author:** ![trevordjones](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trevordjones/32/35637_2.png) [@trevordjones](https://community.hubspot.com/u/trevordjones)\
**Post date:** [April 24, 2020, 12:06pm UTC](https://community.hubspot.com/t/embed-code-for-form-doesnt-work/10062/13 "2020-04-24T12:06:29Z")

</div>

Hi @fzubiran

Is the tracking code installed on the page, and are you recording page views for that page in HubSpot?
