Ship Grain Through the Tags You Already Manage.
If your marketing tags already live in Google Tag Manager, there's no reason to hard-code another script into your site. You add Grain the same way you add anything else: a Custom HTML tag, an All Pages trigger, and a publish. This keeps your team in one workflow, gives you version history and rollback on the tracking, and means you never have to open the codebase to change how Grain loads. Grain is cookieless by default and EU-hosted, so it behaves differently from GA under consent — and once the data is flowing, Kai is what turns it into an answer about where you're losing conversions.
The Setup
Understand why teams route Grain through GTM
Tag Manager gives you one governed place for every third-party script, with versioning, previews, and one-click rollback. Routing Grain through it means the tag ships on the same review process as your ad pixels and GA — no engineering ticket to add or remove it, and a clean audit trail of who changed what. If GTM is already how your team ships tracking, adding Grain there keeps everything consistent instead of scattering snippets across the theme.
Create a Custom HTML tag
In your GTM workspace, go to Tags → New, click Tag Configuration, and choose Custom HTML. Paste the Grain snippet — <script src="https://tag.grainql.com/v4/YOUR_TENANT_ID.js" async></script> — using the Tenant ID from your Grain dashboard. Give the tag a clear name like 'Grain — Analytics Tag' so anyone auditing the container later knows exactly what it is.
Set the trigger to All Pages
Under Triggering, attach the built-in All Pages trigger so Grain loads on every pageview across the site. If you want it firing as early as possible, you can use the Initialization — All Pages trigger instead, which runs before other tags; this is a good choice for analytics you want present from the very first moment of the page. Either way, the goal is universal coverage so no route slips through untracked.
Preview, then publish the container
Use GTM's Preview mode to load your site with the container in debug — confirm the Grain tag shows as fired on the pages you check. Once it looks right, hit Submit → Publish to push the change live. Add a version name and description so the change is documented; if anything looks wrong afterward, you can roll back to the previous container version in a couple of clicks.
Confirm the green light in Grain
Open your Grain dashboard and look for the pulsing green indicator next to your domain. Load a few pages on the live site and watch the events arrive in real time — that's your confirmation the GTM tag is firing and data is flowing. If you don't see green, re-open Preview mode in GTM to check the tag fired and that the Tenant ID in the snippet matches your workspace.
Know how Grain behaves under Consent Mode
GA depends on analytics_storage consent, so when a visitor denies analytics cookies, Consent Mode holds GA back or degrades it to modeled data. Because Grain is cookieless by default, it does not depend on analytics_storage the way GA does — so it can keep giving you real session data where GA falls back to estimates. Configure Consent Mode to match your legal requirements and your privacy policy; the point is simply that a cookieless tag isn't gated on the same cookie consent GA is.
Look for the "Green Light"
Once installed, head over to your Grain Dashboard. A pulsing green indicator next to your domain means data is flowing precisely as it should.
Key Benefit
"Push only GA4 through GTM and you get modeled, sampled, consent-gated pageviews. Add Grain and you get real cookieless session data plus the replay behind each number — and Kai reading those sessions to tell you which step is quietly costing you conversions."
"Kai, where in the funnel are we losing the most conversions?"
GTM gets clean, consistent data into Grain; Kai is what reads it back to you in plain language. Ask it where the funnel leaks, which segment converts worst, or what changed after your last release, and it works from the full cookieless session record rather than modeled estimates. When you want the deep version, Deep Investigation runs a six-phase audit across the funnel and reports exactly where the money is going missing.