Skip to content

Choose your setup

import { Aside, Card, CardGrid } from “@astrojs/starlight/components”;

Do this short decision step before copying the Quickstart snippet. Lightning can either connect a tag to consent with a bridge or block it until consent; the right choice depends on where that tag is managed.

Use the **Google bridge** with your container ID. It loads GTM with the Consent Mode default already in place. Gate each tag inside GTM using its Consent Settings; do not hard-block the container in page HTML. Use the Google bridge with your `G-…` or `AW-…` ID. The CMP loads the Google tag and forwards Consent Mode updates for you. Use a built-in or [custom bridge](/integrations/custom-bridges/) when the vendor supports a consent-aware mode. Use the [script blocker](/integrations/script-blocker/) for vendors that do not.

Set the container ID in bridges.google.tagId:

lightning("init", {
bridges: {
google: { tagId: "GTM-XXXXXXX" },
},
});

The bridge owns the GTM loader and pushes the Consent Mode default before the container starts. Keep your individual tags in GTM and set their built-in Consent Settings there. Verify the result in GTM Preview and with LightningCMP.debug().

Use the same bridge with a measurement or conversion ID:

lightning("init", {
bridges: { google: { tagId: "G-XXXXXXX" } },
});

If your site already loads gtag.js, omit tagId and keep the inline Consent Mode default at the top of <head>; see Google Consent Mode v2.

The Integrations overview explains the same decision for every vendor. As a rule, bridge a vendor that can self-throttle and block a vendor that cannot.

Return to the Quickstart for the common snippet and the install verification step, or open the configurator again if your stack changes.