Versionv1

Google Tag Manager

This guide is opinionated: one clear path that works for most sites. You inject the same window.INTA + uc.js pair as in Quickstart; GTM only controls when it runs relative to other tags.

Prerequisites

  • GTM container installed on the site (GTM-XXXX).
  • Values ready for policy_link, rootDomain, company, and optional gtagId (if using Google tags with CMP-assisted Consent Mode).
  • Permission to publish a container version.

Step 1 — Create the Intastellar CMP tag

  1. In GTM: Tags → New.

  2. Tag type: Custom HTML.

  3. Paste both parts from Quickstart:

    • Inline <script> that sets window.INTA (include gtagId in settings if you use GA4/Ads with this pattern).
    • <script src="https://consents.cdn.intastellarsolutions.com/uc.js"></script>.
  4. Advanced settings → Support document.write: leave off unless your site specifically requires it.

  5. Name the tag clearly, e.g. Intastellar Consents - CMP.

  1. Triggers → New.
  2. Trigger type: Consent Initialization – All pages (in some workspaces: Consent Initialization with All pages).

Assign this trigger only to the CMP tag from Step 1.

Why this matters: Consent Initialization was added so a CMP can run before tags that behave as if consent were already granted. If your CMP tag uses a standard Page View trigger that runs after GA4 in the sequence, you will see pre-consent hits or cookies—see Debugging.

If you use GA4, Google Ads, or other Google tags:

  1. Set settings.gtagId in window.INTA inside the CMP tag (your G-XXXXXXXX or Ads equivalent as documented in Quickstart).
  2. In each Google tag’s GTM configuration, open Consent settings (or your GTM version’s equivalent).
  3. Align default and update consent with your legal position—do not “grant all” by default unless counsel agrees. Details and semantics: Google Consent Mode.

Step 4 — GA4 Configuration tag (example pattern)

Exact UI labels change between GTM versions; the intent is:

  1. GA4 Configuration (or Google tag) tag with your measurement ID.

  2. Trigger: not a bare “All pages” at first paint if that implies full analytics cookies before the CMP—prefer:

    • a trigger that fires after consent (e.g. Custom Event when your policy says analytics is allowed), or
    • GTM’s built-in consent checks on the tag so the tag respects denied analytics until updated.
  3. Consent settings on the tag: require the appropriate consent types for analytics storage / ad storage as per Google’s model.

Concrete GA4 page: Google Analytics 4.

The banner sends a dataLayer event named cookie_consent_update whenever the visitor changes consent (not only on first page load).

  1. Triggers → New → Custom Event
  2. Event name: cookie_consent_update
  3. Use this trigger on tags that must run at that moment (e.g. push to another system, fire a tag that could not use Consent Initialization alone).

Combine with tag Consent settings and vendor docs where relevant. Inspect the event and payload in GTM Preview after clicking accept/reject in the banner—see Events and API.

Step 6 — Meta Pixel (example pattern)

  1. Meta Pixel tag (or Custom HTML from Meta).
  2. Trigger: fires only when marketing/advertising consent is granted in your model—often a custom event or consent-aware condition—not All pages at load before the CMP.
  3. See Meta Pixel.

Step 7 — Preview checklist (do this on staging)

  1. Preview the container; open your site.
  2. In the Tag Assistant timeline, confirm the Intastellar CMP tag fires on Consent Initialization before GA4/Meta fire (if those are configured to wait).
  3. Before clicking accept in the banner: GA/Ads should not behave as fully consented unless you deliberately configured defaults that way (verify in Preview + Network).
  4. After accept: expected requests or mode changes should appear.
  5. Repeat with Reject / minimal consent to confirm restricted behaviour.

Step 8 — Publish

Create a version with a note, e.g.:

CMP: Intastellar on Consent Init; GA4/Meta gated by consent

Common mistakes

MistakeSymptomFix
CMP on Page View onlyGA4 before CMP in timelineMove CMP to Consent Initialization
GA4 + hard-coded gtag.jsDouble hits / wrong consentUse one primary GA path
“All pages” on pixelMeta fires before choiceMarketing trigger only after consent

← Documentation home

Last updated