It took me several months to finally figure out how to successfully pass specific Marketo form submissions into Google Tag Manager, and then pass those custom events into Google Analytics 4. It was quite a journey!
You'll find different variations of this code online, but after speaking with two extraordinarily smart developers*, I landed on the following code — you can grab it from the PasteBin link below or contact me.
Now that you have your 95 lines of custom code (thanks Marketo 🙄), head over to Google Tag Manager.
Let's do the following for each individual Marketo form you want to track:
This could be an entirely separate blog post, so if you need guidance here, Google is your friend. Verify that your new tag(s) are indeed firing correctly in GTM Debug/Preview mode, and remember to publish your GTM instance live.
Once I verified my tags were firing correctly — that's when things got interesting, aka frustrating.
*Before I go any further, I'd like to give a big thank you to those two fantastic developers I mentioned earlier. Each volunteered significant time and helped me diagnose various issues throughout this process, including the GA4 conundrums I'll dive into next. Thank you to:
This is required, so that the form fills actually fire in GTM, and then can pass into GA4. Be patient here — it can take 24-48 hours for those custom events to finally show up in GA4. Also remember to do this in incognito or VPN, if you are blocking your own IP address in GA4.
Go to Admin > Events. If your new custom events (your Marketo form submissions) aren't showing up here after a couple days, there are a couple things you can do.
First, go to Reports > Engagement > Events, as per the screenshot below. Look for the dreaded orange triangle with the exclamation mark — this is a "data thresholding" warning. Data thresholding was likely the root cause of why I did not see my custom events in GA4 appear for weeks.
I went back and forth with Google about this — you can contact Google Support here, and you don't have to be a paid ads customer. I asked them about GA4 data thresholding, why is it being applied, etc. (I've never seen it as an issue in more than a dozen other GA4 accounts)
Google support wrote in an email verbatim:
Unfortunately, there isn’t a clear clarity on what will trigger Google’s data thresholds or the required minimum aggregation thresholds as this is system defined, and we can't adjust them.
Thanks, Google 🙄.
When data thresholding is being applied, you may notice that your custom events are being logged in certain GA4 views/timeframes (see the right side of the graph above), yet those event counts aren't consistent in other GA4 screens/reports. Here's how to correct that issue (which I consider to be a GA4 bug).
If you're still having issues 24 hours after modifying your reporting identity settings, one final thing you can try is: Go to GA4 > Admin > Data Settings > Data Collection, and turn OFF Google Signals.
This was a two-pronged issue that took me many weeks to work through. Neither Marketo nor GA4 are user-friendly when it comes to measuring form submissions, and I hope they improve. Let me know what your experience has been like. Good luck!