Form displays after page content on WordPress


#1

I'm running a number of landing pages through WordPress installs where we are embedding HubSpot forms.

Occasionally on first load of the site the forms are loading after the content and displaying at the bottom of the page rather than in the right place. When you reload, the form displays fine.

This is a massive issue though as all our traffic is paid, and expensive and we can't afford to have the form not displaying right and lose potential leads.

Is anyone able to help solve this issue as support through HubSpot chat was next to useless.


#2

Hey @nickkmg,

Apologies for your frustrations with Support -- happy to connect with them to see where the breakdown was if you provide your HubID so I can check out your ticket?

That said this happens occasionally due to the way our forms dynamically load on the page. Normally this can get taken care of with a property in the form embed code (https://developers.hubspot.com/docs/methods/forms/advanced_form_options). The embedded form would need a target attribute.

Right now your code probably looks something like:

hbspt.forms.create({
        portalId: 'portalIDhere',
        formId: 'formIDhere',
        css:''
      });

but to fix, we'd just need something like:

hbspt.forms.create({
        portalId: 'portalIDhere',
        formId: 'formIDhere',
        target: 'targetGoesHere'
      });

If you provide the page you're working on, I can provide a bit more context as to what that target should be.