We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Nov 15, 2022 10:08 PM
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.
Nov 20, 2022 9:00 AM
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.
Dec 31, 2022 4:10 PM
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!
a month ago
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>
4 weeks ago
@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.
Nov 20, 2022 8:24 AM
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 🙂
Nov 20, 2022 5:39 PM
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?
Nov 17, 2022 9:54 AM
@DSchmidt14 do you have a URL to share? Without context it is hard to say what could be wrong.
Nov 17, 2022 10:53 PM
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>
Nov 18, 2022 9:21 AM
@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.
Nov 17, 2022 11:29 PM - edited Nov 17, 2022 11:55 PM
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
Nov 18, 2022 9:08 AM
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.
Nov 16, 2022 5:19 PM
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 ! |