# Google Tag Manager Community Template

The official PolicyGrain GTM Community Template (clients/gtm-template) sets Consent Mode v2 defaults on Consent Initialization before any tag fires and syncs live choices from Consent Banner v2.

## Capabilities

- All 7 Google Consent Mode v2 signals: ad_storage, analytics_storage, ad_user_data, ad_personalization, functionality_storage, personalization_storage, and security_storage.
- Regional scope defaults: India (IN, DPDP Act 2023 default), EEA + UK + Switzerland, global (ALL), or custom ISO 3166 region codes.
- Tag controls: wait_for_update, ads_data_redaction, and url_passthrough via gtagSet.
- Synchronous returning-visitor restore: reads the first-party pg_consent cookie (or pg:<siteKey>:choice fallback) during Consent Initialization and ignores receipts older than material_version.

## Install in Google Tag Manager

1. Open your Web container in Google Tag Manager and go to Templates > Tag Templates > New.
2. Choose Import from the menu and select clients/gtm-template/template.tpl.
3. Save the template and create a new tag using PolicyGrain DPDP Consent Banner.
4. Enter your PolicyGrain Site Key, choose your region scope (default IN), and attach the trigger Consent Initialization — All Pages.
5. Preview with Tag Assistant to confirm default denied states fire before GA4 or Ads tags, then publish.
