i neet to set advanced conversions in tag manager, but it can't recognize embedded hubspot form as a form so i can't use tag mager form variable or trace email form data field in the thank you page
Hi @Salvoni and welcome to the HubSpot Community. I did a little research, as I haven't personally solved this issue before. Here's what I found.
Setting up advanced conversions in Google Tag Manager for an embedded HubSpot form requires a slightly different approach: Custom Event Tracking. HubSpot forms typically trigger custom events when submitted. You can use these events to track form submissions in Google Tag Manager.
Create a Custom Event trigger:
Go to Triggers > New > Custom Event
Set the Event name to "hubspot-form-submit" (or the specific event name used by your HubSpot form
Create a Data Layer Variable for the email:
Go to Variables > New > Data Layer Variable
Set the Data Layer Variable Name to "hubspotEmail" (or the specific variable name used by HubSpot)
Create a Google Analytics 4 (GA4) tag for the conversion:
Go to Tags > New > Google Analytics: GA4 Event
Configure the tag with your GA4 Configuration
Set the Event Name (e.g., "form_submission")
Add a parameter for the email using your Data Layer Variable
Add custom JavaScript to your website to push the form data to the data layer:
Hi @Salvoni and welcome to the HubSpot Community. I did a little research, as I haven't personally solved this issue before. Here's what I found.
Setting up advanced conversions in Google Tag Manager for an embedded HubSpot form requires a slightly different approach: Custom Event Tracking. HubSpot forms typically trigger custom events when submitted. You can use these events to track form submissions in Google Tag Manager.
Create a Custom Event trigger:
Go to Triggers > New > Custom Event
Set the Event name to "hubspot-form-submit" (or the specific event name used by your HubSpot form
Create a Data Layer Variable for the email:
Go to Variables > New > Data Layer Variable
Set the Data Layer Variable Name to "hubspotEmail" (or the specific variable name used by HubSpot)
Create a Google Analytics 4 (GA4) tag for the conversion:
Go to Tags > New > Google Analytics: GA4 Event
Configure the tag with your GA4 Configuration
Set the Event Name (e.g., "form_submission")
Add a parameter for the email using your Data Layer Variable
Add custom JavaScript to your website to push the form data to the data layer:
Hey @Salvoni, thank you for posting in our Community!
For advanced conversions with embedded HubSpot forms in Tag Manager, try using a click trigger on the submit button instead of a form submission trigger. Alternatively, add a Custom JavaScript trigger that listens for HubSpot form submissions. You can use the onFormSubmit callback to push events to the data layer, allowing GTM to capture the form interaction. Finally, verify the setup in GTM Preview mode and check conversions in Google Analytics or Google Ads.