Before you start
Install one GTM web container, emit a deliberate data-layer event, and verify the tag in Preview before publishing a named version. GTM's installation dialog may show an updated head snippet; use the exact code it generates. If your account uses the classic two-part snippet below, place the JavaScript as high in <head> as possible and the noscript iframe just after the opening <body>. Replace both GTM-XXXXXXX placeholders with your container ID. See Google's current installation instructions.
1. Install the container
This is the classic two-part GTM container pattern, which Google says continues to work. Add this JavaScript snippet inside the page <head>:
Then add its account-specific no-JavaScript fallback immediately after the opening <body>:
<!-- Google Tag Manager: replace with your container ID -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');
</script>
<!-- End Google Tag Manager --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>2. Emit a generic website-to-GTM event
After the app confirms the form succeeded, it can push a message into the existing data layer:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'generate_lead', form_type: 'demo' });This is a generic website-to-GTM event push. The data layer is a shared message queue for a tag manager; it is not a vendor pixel and does not send data to GA4, Meta, TikTok, Microsoft, or another platform by itself. In GTM, create a Custom Event trigger, Data Layer Variables, and the destination's actual vendor tag with field mapping. See Google's data layer guide. A push only proves the site emitted a message.
3. Preview before publishing
Use Preview and Tag Assistant to inspect the event, variables, trigger, consent state, and exact vendor tag that fired. Test both a failed and successful form. An event in Preview is not proof that an external platform processed it. Save a named version and publish only after the mapping and privacy review.
Use the dashboard to inspect values this browser exposes. Preview and Tag Assistant show which GTM tags fire; they do not prove that a vendor processed the event.
Official references
- Install a web container Checked November 10, 2026
- The data layer Checked November 10, 2026
- Preview and debug containers 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.
- v1.2Corrected placement for the classic two-part GTM snippet and distinguished it from the updated installation flow.