APIs & Integrations

dandrust
Member

Using progressive fields on embedded form

Hello -

We're trying to get some Hubspot forms embedded on an external site. These forms have progressive fields but we're having some trouble getting them to work. We consistently see the "This form was submitted before the tracking code was installed. Some information may not have been captured as a result." despite the fact that the tracking code is being installed on the page via GTM.

I thought this was probably an issue with timing (form loading before tracking code was loaded) so I look around for an event that we could wait for before initializing the forms. Seems that the tracking code sets up a `_hsq` array and two global variables `_hstc_loaded` and `_hstc_ran`.

However, none of those side effects are present when the tracking code is loaded via GTM. Though if I include the tracking code in a `<script>` tag on the page I see those side effects.

Regarding the forms -- it seems that before being rendered they try to fetch analytics from the tracking code by pushing a request to the `_hsq` array. Our GTM implementation of the tracking code doesn't seem to be consuming items pushed to the `_hsq` array though. I noted this by observing that pushing a function that logs to the console to `_hsq` produces output when the tracking code is loaded via `<script>` tag but not when loaded via GTM.

So my questions are:

1 Is it expected behavior that `_hsq`, `_hstc_loaded` , `_hstc_ran`, and the magic _hsq event listener aren't present in the client when the tracking code is loaded via GTM (or maybe we've done something wrong?)


2 Is it possible for forms to get the necessary tracking data for progressive fields to work when the tracking code is loaded via GTM.

Thanks in advance for the help!

Dan

0 Upvotes
1 Reply 1
IsaacTakushi
HubSpot Employee
HubSpot Employee

Using progressive fields on embedded form

Looks like this might be a duplicate of this post which my colleague @WendyGoh responded to.

Isaac Takushi

Associate Certification Manager