Reporting & Analytics

DSchmidt14
Member

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Hi, our Hubspot form is embedded as an iframe on a Wix website, and the conversion has been tracked using Hubspot event listener.

 

It worked fine for a year until the end of last month (Oct 2022). It stopped tracking in Google Ads for about 4 days, but started working again at the beginning of this month. However, it stopped working again 6 days ago. I tested that GTM container loaded correctly but the conversion is still not tracked in GTM or Google Ads.  

Does anyone have suggestions on how I can fix this? Thank you.

13 Replies 13
franksteiner79
Key Advisor

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Joining this thread to see if there has been any feedback from HubSpot or if @derekcavaliero had the chance to do some more testing.

 

I am working with a customer who experienced the same thing around Oct last year. I am no GTM expert myself, so just wondering if there is a way to troubleshoot/fix the issue of form submissions not reigstering as conversions in GA?

 

Cheers

Frank

Found my comment helpful? Great! Please mark it as a solution to help other community users.


Frank Steiner

Marketeer | HubSpot Expert | CRM Consultant

InboundPro

Let's Talk About Your Project
EMartin51
Participant

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

After some digging, I think this may be related to this update here:
https://developers.hubspot.com/changelog/forms-rendered-by-embed-code-are-updating
They're explicitly stating the global form events (https://legacydocs.hubspot.com/global-form-events) will continue to work, but it seems like a strange conincidence that the script would stop working just at the same time the embedded forms get an update.

DSchmidt14
Member

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Hi @EMartin51 just wondering whether you've found a fix for this issue? We are still trying to find a solution but so far no luck. Thanks!

0 Upvotes
EMartin51
Participant

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Hi @DSchmidt14 I've found that using the existing form listener script, but without pushing the 'hs-form-guid' into the dataLayer, has now been working. We've been using it for several weeks and so far, so good, no issues at all; so basically the same as your script but with this line removed:

'hs-form-guid': event.data.id

 

Updated script:

 

<script type="text/javascript">
  window.addEventListener("message", function(event) {
    if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
      window.dataLayer.push({
        'event': 'hubspot-form-success'
      });
    }
  });
</script>

 

 

0 Upvotes
derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

@EMartin51 / @DSchmidt14 I do not see these same issues you are describing, if anything it is likely related to a form redirecting the page before the event/conversion is able to complete. 

 

For what it is worth, I have clients using (and referencing) the event.data.id and it does not impact our ability to properly fire conversion scripts. This is likely a specific issue with your configuration and not the callback functioning incorrectly.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Upvotes
EMartin51
Participant

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

We're a maerkting agency experiencing the same issue - dozens of our clients are using the same script; was working fine for years, and now they're all having issues and it seems to have stopped working entirely during the last 30 days or so. So definitely not a one-off, I've tried modifying the script but the listener doesn't recognise any of the callbacks I've tried. Pretty bad, I hope they release an update on https://legacydocs.hubspot.com/global-form-events or address it here - or if anyone has found a fix, that would be great 🙂

derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

We're also an agency and use these callbacks in some proprietary software and haven't had any issues with them in that same timeframe. Can you DM me some additional URL examples so I can take a deeper look? 

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Upvotes
derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

@DSchmidt14 do you have a URL to share? Without context it is hard to say what could be wrong.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Upvotes
DSchmidt14
Member

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Hi @derekcavaliero, thanks for your help! Here's an example of the webpage that the Hubspot form is embedded in: https://www.entertainmenteducationendowment.org/join-us

This is the conversion page URL for the Hubspot form: info.discoveryspotlight.com/entertainment-education-endowment


The custom HTML tag was set up in GTM and no changes have been made for a year:

<script type="text/javascript">
  window.addEventListener("message", function(event) {
    if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
      window.dataLayer.push({
        'event': 'hubspot-form-success',
        'hs-form-guid': event.data.id
      });
    }
  });
</script>

 

derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

@DSchmidt14 The issue you have is that you are embedding a form that is embedded in another page via a manual <iframe>. That would mean that the postMessage event that the form emits on submit is happening in the context of the info.discoveryspotlight.com/entertainment-education-endowment page. You should check GTM to see what your trigger conditions are for using that dataLayer event - perhaps something did change (even if small) that is causing issues. The form callbacks seem to be working as intended.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Upvotes
LSantana8
Participant

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

We are also experiencing the same issue, event.data.type is "undefined" as is eventName and id. 

 

 if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
    const hubspotFormId = event.data.id;
...
}

 

 This started today, November 17th, we have changed nothing in our forms.
See: https://legacydocs.hubspot.com/global-form-events

 

Screen Shot 2022-11-17 at 11.53.40 PM.png

0 Upvotes
derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Interesting, if that is the case then HubSpot changed something on their end with how the global callbacks work - which would be very bad for a lot of businesses that rely on these features working as described in their docs. Let me run some tests and see if I can replicate.

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
PamCotton
Community Manager
Community Manager

Hubspot form conversion stopped tracking in Google Ads / Google Tag Manager

Hello @DSchmidt14, thank you for posting in our Community!

To our top experts @Jonno_Price @Daniel_Bleich @derekcavaliero any recommendations to @DSchmidt14 matter?

 

Thank you,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes