# Install a Google Tag Manager web container Install one GTM web container, emit a deliberate data-layer event, and verify the tag in Preview before publishing a named version. - Canonical: https://satracking.net/guides/instalar-google-tag-manager/ - Language: en - Category: platforms - Level: intermediate - Published: 2026-11-10 - Updated: 2026-11-10 --- ## 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 `` as possible and the noscript iframe just after the opening ``. Replace both `GTM-XXXXXXX` placeholders with your container ID. See Google's [current installation instructions](https://support.google.com/tagmanager/answer/14847097?hl=en). ## 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 ``: Then add its account-specific no-JavaScript fallback immediately after the opening ``: ~~~html ~~~ ~~~html ~~~ ## 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: ~~~js 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](https://developers.google.com/tag-platform/tag-manager/datalayer). 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](/audit/) 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 — https://support.google.com/tagmanager/answer/14847097?hl=en (verified 2026-11-10) - The data layer — https://developers.google.com/tag-platform/tag-manager/datalayer (verified 2026-11-10) - Preview and debug containers — https://support.google.com/tagmanager/answer/6107056?hl=en (verified 2026-11-10)