Hubspot Contact Form



  • I'm trying to add my HubSpot contact form into a side column of one page. I have the code:

    <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"></script>
    <script>
    hbspt.forms.create({
    portalId: "4864158",
    formId: "f5ed1a95-6725-4571-88ef-2c7c1e6a9e09"
    });
    </script>

    I added it to the "header" option on the page. I'm unsure how to actually add it to the content in the page to load the header form. I tried pasting the same code into the HTML widget box, but that didn't work.


  • administrators

    You might want to add the following code to head section and rest in an html widget.

    <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/shell.js"></script>
    

    If possible, share the screenshot where you generated the code. The same page might have instruction where to add the code.



  • Hello, I tried splitting the code up, and purging my cache, and that didn't work either.

    Hubspot doesn't provide many instructions for embedding in Wordpress because they want you to pay to upgrade your plan to get the widget that automatically embeds them in. Their support page basically shows you just plopping the code into the page body and it magically working...which it doesn't by default.

    Here is a couple of screen shots of the Hubspot embed code: https://drive.google.com/file/d/1zvfC0jUMKgqlBXbH7NGHE7pKecpe53KS/view?usp=sharing
    and then the Wordpress editor where I have the code and the Custom HTML box where the rest of the Javascript code needs to go: https://drive.google.com/file/d/1vydhoyNQ52U2r-lPczevB_jsz4ITPOgg/view?usp=sharing

    Thanks for helping me with this 🙂


  • administrators

    The code works fine by simply adding it to Custom HTML widget in WordPress. Since you are using a page builder plugin you do not need my plugin for this purpose.

    PS: when I tested I found the following text along with the form

    "Social Media Management Info & Pricing Request
    When executed properly, social media can have a 100% higher lead-to-close rate than other outbound marketing tactics and can be 3X less expensive to advertise through than traditional media. #GOALS"


  • administrators

    Caching might be the culprit. Check source code of the page after adding the code and try to locate hubspot code in it. If you are using Google Chrome or Firefox hit "Ctrl+u"



  • Thank you. It's not working still for me. I'll check the caching portion, and if it's still not working, then I might reach out to the template maker to see if the template is blocking it.


  • administrators

    OK. Let me know if you need any further help.



  • It was the caching issue and it's now working. Thanks again for the help!