Integrations
Google Consent Mode v2
Send every Consent Mode signal, mapped from your categories.
The script sends all Google Consent Mode v2 signals, mapped from the visitor's categories.
| Google signal | Category |
|---|---|
analytics_storage | analytics |
ad_storage, ad_user_data, ad_personalization | marketing |
functionality_storage, personalization_storage | functional |
security_storage | always granted |
Turn it on
<script src="https://v1.pactbase.in/sdk/v1/pactbase.js" data-org="ORG_ID" data-site="SITE_KEY" data-google-consent-mode="advanced"></script>With the attribute you add nothing else. Before anything else runs, the script:
- Creates
dataLayerandgtagif the page has not. - Sends
consent defaultwith everything exceptsecurity_storagedenied, andwait_for_update: 500. - Turns on ad data redaction, so ad click ids are stripped while
ad_storageis denied.
It sends consent update whenever the visitor decides, and straight after the default on a repeat visit.
Basic or advanced
| Mode | Google tags before consent | What Google receives |
|---|---|---|
basic | Held back like other trackers | Nothing until the visitor consents |
advanced | Load straight away. Scripts and pings from Google Tag Manager, Google Analytics and Google Ads hosts are never held | Cookieless pings, which Google uses to model conversions from visitors who decline |
Rules
- The script must be the first script in
<head>, withoutasync, so the default comes before any Google tag. - In
advancedmode, do not mark Google tags up withdata-category. That holds them back and makes itbasic. - If your page already sent its own
consent defaultfirst, for example with per-region defaults, the script leaves it alone and only sends updates. - Without the attribute, your page must set the default itself, before any Google tag. The script still sends the update calls if the page defines
gtag. - For Google tags loaded through Tag Manager, use Consent Mode in the container rather than marking each tag up.