We’re evaluating HubSpot as a Marketing automation tool to be used with our Wordpress website. We’re using a tool called Elementor for Wordpress and use the shortcodes generated by the Hubspot plug-in for Wordpress to render the forms. That all works perfectly.
We’re now trying to restore the tracking of form submissions as events in Google Analytics. Since we don’t manually load the HubSpot JS, the Wordpress plug-in takes care of that, so we can’t use the `onFormSubmit` callback on `hbspt.forms.create`.
So instead we’re trying to listen to `hsvalidatedsubmit` by adding this code to the footer of all pages:
```
window.addEventListener(‘hsvalidatedsubmit’, function (e) {
console.log(e);
}, false);
```
However this event never fires. How can we observe form submissions withHubspot Wordpress plug-in so we can fire events in Google Analytics?
Thank you for reaching out to the Community! I’m not too familiar with Google Analytics myself, but I wanted to tag in a couple of subject matter experts to see if they have any input on this matter:
We use our own developement - GTM tag to track all the needed data and inject them as a hidden Non HubSpot form fields, that can still be tracked by HubSpot. Thus, it can be almost any WP form. The rest is done by a connector (Zapier dosn’t do this preperly). BTW if you want to track offline conversions/sales, than GA CID is by far not a single parameter you need to send to GA in order to bypass its filter as well as to send a correct IP (geo) or not a server, but a user.
I’ve written a tutorial on my blog on how to track Hubspot form submits with Google Analytics. It’s for cases exactly like yours. Blog post has copy-pasteable code snippets and a video for step-by-step instructions. Hope it’s helpful!