Skip to main content

Google Tag Manager

Install the OptSens banner with the OptSens CMP template for Google Tag Manager. The template sets Google Consent Mode v2 defaults, loads the OptSens script, and updates consent when a visitor chooses.

Safari Private Browsing and GTM

Safari Private Browsing blocks googletagmanager.com, and a banner delivered only through GTM does not show there. To cover those visitors, load OptSens with the direct snippet in your page <head>. With the direct snippet installed this template is not required: the banner shows in every browser, and the tags inside GTM still fire according to the visitor's consent.

Import the template

  1. In GTM, open Templates and click New under Tag Templates.
  2. Search the Community Template Gallery for OptSens CMP and add it.
  3. Save the template.

Add the tag

  1. Open Tags and create a new tag from the OptSens CMP template.
  2. Set Domain ID to the value from your dashboard Integration page.
  3. Leave CDN Base URL empty to use the default, https://cdn.optsens.com.
  4. Set the trigger to Consent Initialization - All Pages. This runs the tag before every other tag, and consent defaults are set first.
  5. Save.

The template sets all seven Google Consent Mode v2 signals. The defaults are denied for every storage type except security_storage, which is granted. You can override each one in the tag, and you can add Region-specific defaults for codes such as US-CA or EU.

Advanced settings let you tune Wait for update, URL passthrough and Ads data redaction. The defaults match Google's recommended setup.

Publish

  1. Use Preview to confirm the tag fires on Consent Initialization.
  2. Submit and publish the container.

After installing

  1. Open your site in a private window. The banner shows on first visit.
  2. Run the implementation check. During first-time setup it runs as the onboarding Verify step, and you can run it at any time from the dashboard Integration page. It confirms the snippet, consent signals and Google Consent Mode v2.
  3. Work through Verify installation.

For passing consent into other tags, see GTM dataLayer. If the banner does not show, start with Install troubleshooting.