Before you start
Install the Google tag once, send a confirmed generate_lead event, and check the tag, measurement ID and DebugView receipt without duplicate collection. Use a test property while setting this up.
1. Install the Google tag once
For a direct gtag.js install, place this in the shared head and replace both example measurement IDs. G-XXXXXXXXXX is a placeholder.
<!-- Google tag: replace both placeholders with your GA4 measurement ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>If GTM already owns your tags, configure the Google tag there instead of installing a second copy. The config call can send a page_view, so check your current setup before adding another. If consent is required before Google loads, do not load this code before the visitor makes that choice.
2. Send a confirmed event
Call GA4 after the application confirms that the form succeeded:
gtag('event', 'generate_lead', { form_type: 'demo' });Replace demo with a controlled value that does not identify anyone. With GTM, send a generic data-layer message, create a Custom Event trigger and variables, and map them into a GA4 Event tag. The queue message does not reach GA4 unless a configured tag forwards it. Do not send both the direct call and GTM tag for the same action.
3. Verify the result
Use Tag Assistant to confirm the intended tag, measurement ID, and parameters. Then check GA4 DebugView and Realtime. A browser request or detected tag shows attempted delivery, not that GA4 processed the event.
Check for duplicate base tags, SPA route listeners, consent blocking, filters, and the wrong property. See Google's Google tag guide, GA4 event guide, and DebugView help. Use the dashboard to inspect browser-visible activity, then confirm event receipt in GA4 DebugView.
Official references
- Google tag setup Checked November 10, 2026
- GA4 event setup Checked November 10, 2026
- GA4 event parameters Checked November 10, 2026
- GA4 DebugView Checked November 10, 2026
What changed
- v1.0Initial bilingual guide; provider setup and validation steps checked against official documentation.
- v1.1Revised both language versions with verified provider code and clearer data-layer-to-tag mapping; checked official setup and validation references.