Hi people, I hope you can help me here. I’m not sure if it’s brain fog or what but I can’t seem to track submissions on an embedded Hubspot form here :S
We have the hubspot tracking tag enabled and working
We’d need to track these submissions and then be able to use them in reports on Piwik analytics (event and also Goal).
I have read help documentation (How to track a form submission | Piwik PRO help center), but I don’t seem to get it working, I can’t find css class, etc. I remember that back in our GTM days, someone used a hubspot form event listener, but I’m not sure if that applies here.
Thanks a lot in advance
Yes, I think the same approach would still apply with the Piwik PRO Tag Manager. Hubspot forms are a bit different as they are embedded in an iframe, so the default approach (one described in the Help Center article) won’t work.
You should be able to capture the form submission event with this:
My example requires both the opening and closing tag (<script></script>). You can also add the ID too, it all depends on what kind of data you’d like to capture.
You can even use the GTM tag that you have created, the one I posted was just an example of the event handler. Please note that the tag you are currently using in GTM is pushing a dataLayer event which has to be picked up later by a dataLayer event trigger.