Last updated: August 2026. Based on a live GTM + GA4 implementation for a Shopify client — including the parts that don’t work as expected.
Google Forms and other embedded forms don’t always play nice with GA4’s automatic tracking — and depending on how your form is built, the fix is completely different.
Here’s the solution I could find to Track Google Form Submission in GA4:
using Google Tag Manager (GTM), we can use a “Listener” script. This is the most reliable way because Google Forms are “black boxes” (iframes)—GTM can’t see what’s happening inside them, but it can see when the iframe reloads.
When a user hits “Submit” on a Google Form, the iframe reloads itself to show the “Thank you” message. We will track that second load.
Before we get into that specific setup, here’s the bigger picture — because how you track form submissions in GA4 depends entirely on what kind of form you’re dealing with.
There are three situations, and three different fixes:
Your form is a normal HTML form on your own domain. GA4 can probably already see it, automatically, with zero setup. Jump to Method 1.
Your form is a normal HTML form, but you want more control — custom event names, specific conversion tracking. Use GTM’s built-in Form Submission trigger. Jump to Method 2.
Your form is a Google Form embedded via iframe (like the Shopify example below), or any other cross-domain embedded form. Neither of the above will work — the browser blocks GTM from seeing inside a cross-domain iframe. That’s what the rest of this article walks through. Jump to Method 3.
Method 1: Let GA4 Track Forms Automatically (No Code)
GA4 can already be doing this for you, right now, without a single line of code.
It’s called Enhanced Measurement, and it fires two events on its own:
form_start — fires the first time a visitor interacts with any field in a form during their session.
form_submit — fires when that form is submitted.
How to Turn It On
Go to GA4 Admin → Data Streams → select your web stream → Enhanced measurement → toggle “Form interactions” on.
That’s it. No GTM, no custom code.
Where This Falls Short
Enhanced Measurement fires on the submit action, not on a confirmed success. A form with a validation error can still fire form_submit even though nothing was actually sent.
It also only works for a real HTML <form> element living on your own domain. It cannot see inside an embedded, cross-domain iframe — which is exactly the situation with a Google Form embedded on a Shopify page. That limitation is the whole reason Method 3, further down, exists.
Method 2: GTM’s Built-In Form Submission Trigger
Want a custom event name, or need this to work as a Google Ads conversion without touching Enhanced Measurement settings? Use GTM directly.
This works for any standard form on your own domain — a Shopify contact form, a WordPress form, anything that isn’t embedded via iframe.
Setup
In GTM, create a new trigger. Trigger Type: Form Submission.
Under “This trigger fires on,” choose “Some Forms” if you only want to track one specific form, and add a condition matching its Form ID or Form Classes.
Create a GA4 Event tag, give it a clear name like form_submit_contact, and fire it on the trigger you just built.
Preview and test in GTM before publishing, the same way you would for any other trigger.
One Thing to Check
GTM’s native Form Submission trigger relies on the browser’s default form submit event. If your form uses JavaScript to intercept and block that default submission (common with some form builders and validation libraries), this trigger may not fire reliably — you’ll need the “Wait for Tags” and “Check Validation” settings, or a custom event trigger instead.
Method 3: Embedded Google Forms (iframe) — the Shopify Example
Neither method above will work if your form is a Google Form sitting inside an iframe, because the browser won’t let GTM see across that domain boundary. Here’s the workaround, using the real client scenario that prompted this whole setup.
Consider this scenario: my client is in the Adventure Motorcycle Accessories business. Occasionally, he co-hosts bike touring festival events with the rider community.
He’s also using his site to draw traffic to this event, but the organizer wants to use a Google Form to collect the leads — and my client has to comply.
So he’s not using his website contact form to track submissions. He’s simply pasted the Google Form link on the event page to collect leads.
This is fine for the event organizer. A nightmare for a marketer trying to track it.
Quick context before we set this up:
- Traffic driving channel to the client site: Organic and Google Ads
- Website built on: Shopify
- Tracking used tools: GA4 & GTM
Here’s exactly how I tracked it — step by step.
Step 1: Create the Iframe Listener (Custom HTML Tag)
This script sits on your Shopify page and “watches” the Google Form.
- In GTM, go to Tags > New.
- Tag Type: Custom HTML.
Paste this code:
JavaScript
<script>
(function() {
var iframe = document.querySelector(‘iframe[src*=”docs.google.com/forms”]’);
if (!iframe) return;
var loadCount = 0;
iframe.onload = function() {
loadCount++;
if (loadCount > 1) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
‘event’: ‘google_form_submit’,
‘form_name’: ‘Camping Festival’
});
}
};
})();
</script>
- Triggering: Set to Page View on the specific page: Page URL contains (add the URL where google form link is pasted)
- Save as: cHTML – Google Form Listener.
Step 2: Create the Custom Event Trigger
Now we need GTM to recognize the google_form_submit event the script just created.
- Go to Triggers > New.
- Trigger Type: Custom Event.
- Event Name: google_form_submit (must match the code exactly).
- This trigger fires on: All Custom Events.
- Save as: Custom – Google Form Submitted.
Step 3: Create the GA4 Event Tag
Finally, send that data to Google Analytics.
- Go to Tags > New.
- Tag Type: Google Analytics: GA4 Event.
- Measurement ID: Enter your GA4 ID (starts with G-).
- Event Name: generate_lead (This is the standard GA4 name for form sign-ups).
- Triggering: Select the trigger you made in Step 2 (Custom – Google Form Submitted).
- Save as: GA4 – Event – Camping Form Submission.
Step 4: Preview and Test
- Click Preview in GTM.
- Enter your URL where the google form link is pasted.
- Fill out the form and submit it.
- In the Tag Assistant window, look for the google_form_submit event on the left sidebar.
- If it appears, your tag fired successfully!
Important Note: If you have multiple pages in your Google Form (e.g., “Next” buttons), this method might trigger on every page click. If your form is just one page, this works perfectly.
Now Let’s track the event created above as Conversion and import in Google ads to add it on any Campaign you’re running to drive traffic for festival event.
Once your GTM tags are live and firing, you need to tell GA4 that the generate_lead event is specifically a Conversion (now called a Key Event in the new GA4 interface).
Since you’ve named the event generate_lead in GTM, GA4 often marks this as a conversion automatically because it’s a standard “Recommended Event.”
However, here is how to verify and manually set it up to ensure it shows up in your marketing reports.
Step 1: Mark as Key Event (Conversion)
- Log into your Google Analytics 4 account.
- Go to the bottom left and click Admin (the gear icon).
- Under the Data Display section, click on Events.
- Look for generate_lead in the list.
- Toggle the switch under Mark as key event to “On.”
Note: If the event hasn’t appeared in the list yet (it can take 24 hours to show up), you can do it manually:
- Go to Admin > Key Events.
- Click New key event.
- Type the name exactly: generate_lead.
- Click Save.
Step 2: Change “Counting Method” (Optional but Recommended)
For a camping festival registration, you probably only want to count one registration per person, even if they accidentally submit the form twice.
- In the Key Events list, find your generate_lead event.
- Click the three dots (⋮) on the far right.
- Click Change counting method.
- Select Once per session (instead of “Once per event”). This prevents “over-counting” if someone refreshes the page.
- Click Save.
Step 3: View Your Data
After 24 hours, you can see which marketing channels are driving these sign-ups:
- Go to Reports > Acquisition > Traffic acquisition.
- Look for the column titled Key Events.
- Select generate_lead from the dropdown menu to see exactly which sources (Facebook ads, Instagram, Organic Search) are sending you the most registrations for the Tourbugs Camping Festival.
Final: You can also import this to your google ads account although it will be automatically added after 24 hours. Just add the conversion action to your traffic Campaign it would start tracking all form submission as conversion.
GA4 Form Tracking FAQ
What is the form_submit event in GA4?
It’s one of GA4’s automatic Enhanced Measurement events. It fires whenever a visitor submits a standard HTML form on your site, with no extra setup required — as long as Enhanced Measurement’s “Form interactions” toggle is on and the form isn’t inside a cross-domain iframe.
Does GA4 track failed or invalid form submissions?
It can. form_submit fires on the submit action itself, not on confirmed success, so a form that fails validation can still register the event. If you need to track successful submissions only, use a GTM-based method tied to a thank-you page or a confirmation trigger instead.
How do I track a form submission in GA4 using GTM?
For a standard form on your own domain, create a Form Submission trigger in GTM and attach a GA4 Event tag to it. For a form embedded via iframe — like a Google Form — you need a custom listener script instead, since GTM can’t see inside a cross-domain iframe. See Method 3 above.
Is there a submission tracking ID in Google Forms?
Google Forms doesn’t expose a marketer-facing “tracking ID” for each response beyond a timestamp and row number in the results sheet. If you need to trace a specific submission back to the campaign or ad that drove it, add a hidden pre-filled field to your form URL (carrying a UTM value or gclid) so each response row captures it — and optionally push that same value into GA4 as an event parameter for cross-checking.
How do I get a submission tracking ID in Google Form for ad attribution?
Use Google Forms’ pre-filled link feature: build a pre-filled URL with a hidden or visible field for your tracking value, append it to the link you use in ads or email, and it will populate automatically for each respondent. Combine this with UTM parameters on the page hosting the form for full-funnel attribution.
Comments are closed.