<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error &amp;quot;ReferenceError: hbspt is not defined&amp;quot;  with embed code for form in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/305533#M28921</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this form for a PDF download on the website:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;hbspt.forms.create({&lt;BR /&gt;portalId: "5869165",&lt;BR /&gt;formId: "4b903862-c21b-4565-8311-3ef740bd562f"&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I embed it on my WordPress site (with the Modal Text / HTML Link builder block) it always gives me this "unknown error": "&lt;STRONG&gt;Error "ReferenceError: hbspt is not defined&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;This leaves me unable to even make changes to the page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried starting over and tried adding &amp;lt;div&amp;gt; tags in the embed code (after research on this forum) but nothing seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas what's wrong with the embed code and how I can solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 11:22:01 GMT</pubDate>
    <dc:creator>LisbethN</dc:creator>
    <dc:date>2019-12-04T11:22:01Z</dc:date>
    <item>
      <title>Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/305533#M28921</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this form for a PDF download on the website:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;hbspt.forms.create({&lt;BR /&gt;portalId: "5869165",&lt;BR /&gt;formId: "4b903862-c21b-4565-8311-3ef740bd562f"&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I embed it on my WordPress site (with the Modal Text / HTML Link builder block) it always gives me this "unknown error": "&lt;STRONG&gt;Error "ReferenceError: hbspt is not defined&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;This leaves me unable to even make changes to the page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried starting over and tried adding &amp;lt;div&amp;gt; tags in the embed code (after research on this forum) but nothing seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas what's wrong with the embed code and how I can solve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 11:22:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/305533#M28921</guid>
      <dc:creator>LisbethN</dc:creator>
      <dc:date>2019-12-04T11:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/305788#M28947</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/112545"&gt;@LisbethN&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error &lt;STRONG&gt;"ReferenceError: hbspt is not defined&lt;/STRONG&gt;&lt;SPAN&gt;" likely means that when calling the function "hbspot" on your page to try and load the form create script, the shell.js hasn't been created. This could means that the shell script loads after all the html has loaded or there's an issue loading the shell script.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this case, it looks like when embedding HubSpot form on a WordPress page, there are some potential issues that may cause the code to break - Refer to this documentation:&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/forms/why-doesn-t-my-externally-embedded-hubspot-form-work" target="_blank"&gt;Externally embedded HubSpot form isn't working&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hence, could you try adding HubSpot forms to your WordPress page using any one of the options detailed here:&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/integrations/create-a-hubspot-form-in-wordpress" target="_blank"&gt;Add HubSpot forms to WordPress pages and posts&lt;/A&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if this works for you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 07:23:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/305788#M28947</guid>
      <dc:creator>WendyGoh</dc:creator>
      <dc:date>2019-12-05T07:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/675331#M55502</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm managing a Kentico website and I encountered the same error as the original poster.&lt;/P&gt;&lt;P&gt;After a great deal of frustration, I was able to resolve the issue by simply adding "https:" to the front of the source path.&lt;/P&gt;&lt;P&gt;I'm not sure why the https:// is excluded from the src path in the generated code snippets, but oh well.&lt;/P&gt;&lt;P&gt;Hopefully this helps anyone else who encounters the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 03:42:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/675331#M55502</guid>
      <dc:creator>RPieczul</dc:creator>
      <dc:date>2022-08-04T03:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/746793#M60708</link>
      <description>&lt;P&gt;Loading the script dynamically works well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;&lt;SPAN&gt;script&lt;/SPAN&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  (&lt;SPAN&gt;() =&amp;gt;&lt;/SPAN&gt; {
    &lt;SPAN&gt;const&lt;/SPAN&gt; script = &lt;SPAN class=""&gt;document&lt;/SPAN&gt;.&lt;SPAN class=""&gt;createElement&lt;/SPAN&gt;(&lt;SPAN&gt;"script"&lt;/SPAN&gt;);
    script.&lt;SPAN class=""&gt;setAttribute&lt;/SPAN&gt;(&lt;SPAN&gt;"type"&lt;/SPAN&gt;, &lt;SPAN&gt;"text/javascript"&lt;/SPAN&gt;);
    script.&lt;SPAN&gt;src&lt;/SPAN&gt; = &lt;SPAN&gt;"https://js.hsforms.net/forms/embed/v2.js"&lt;/SPAN&gt;;

    script.&lt;SPAN class=""&gt;addEventListener&lt;/SPAN&gt;(&lt;SPAN&gt;"load"&lt;/SPAN&gt;, &lt;SPAN&gt;() =&amp;gt;&lt;/SPAN&gt; {
      hbspt.&lt;SPAN&gt;forms&lt;/SPAN&gt;.&lt;SPAN class=""&gt;create&lt;/SPAN&gt;({
        &lt;SPAN&gt;region&lt;/SPAN&gt;: &lt;SPAN&gt;"..."&lt;/SPAN&gt;,
        &lt;SPAN&gt;portalId&lt;/SPAN&gt;: &lt;SPAN&gt;"..."&lt;/SPAN&gt;,
        &lt;SPAN&gt;formId&lt;/SPAN&gt;: &lt;SPAN&gt;"..."&lt;/SPAN&gt;,
      });
    });

    &lt;SPAN class=""&gt;document&lt;/SPAN&gt;.&lt;SPAN&gt;head&lt;/SPAN&gt;.&lt;SPAN class=""&gt;append&lt;/SPAN&gt;(script);
  })();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;SPAN&gt;script&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:49:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/746793#M60708</guid>
      <dc:creator>Gifford</dc:creator>
      <dc:date>2023-01-25T15:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/748908#M60895</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/510449"&gt;@Gifford&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 17:01:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/748908#M60895</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-01-30T17:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error "ReferenceError: hbspt is not defined"  with embed code for form</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/761622#M61743</link>
      <description>&lt;P&gt;When using the above code, the form is loading infinitely. Could you please share your solutin for it if you have one?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-02-27 101702-error.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/86238i4799A3C9CEC23184/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-02-27 101702-error.png" alt="Screenshot 2023-02-27 101702-error.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 18:19:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-quot-ReferenceError-hbspt-is-not-defined-quot-with-embed/m-p/761622#M61743</guid>
      <dc:creator>SUdo5</dc:creator>
      <dc:date>2023-02-27T18:19:08Z</dc:date>
    </item>
  </channel>
</rss>

