Consent Management without Google Tag Manager (GTM)
Overview
This TrueVault Knowledge Center article explains how to manage content consent without using Google Tag Manager (GTM) by utilizing polaris.js's built-in tag management capabilities.
When consent is implemented this way, scripts still load on the page before Polaris CMP removes them. Because of this, TrueScan can report these scripts as not respecting consent. In TrueScan, choose Managed by a platform and set the platform to TrueVault.
Due to the above, we recommend using Google Tag Manager so scripts can wait for consent before they load.
Supported Consent Purposes
The following consent purposes can be used for content control:
essentialmarketingpreferencesstatisticstv_not_opted_out
Implementation Examples
External Script Example
You can control external scripts by adding the data-polaris-consent attribute:
<script data-polaris-consent="statistics" src="stats-script.js"></script>
<script data-polaris-consent="marketing,preferences" src="ad-script.js"></script>
Inline Script Example
For inline scripts, use the same attribute approach:
<script type="text/javascript" data-polaris-consent="marketing">
console.log("I need marketing consent to run")
</script>
<script type="text/javascript" data-polaris-consent="statistics,marketing">
console.log("I need both statistics and marketing consent to run")
</script>
Implementation Requirements
polaris.jsmust be loaded first in the<head>element- Do not load
polaris.jswithdeferorasyncattributes to ensure proper initialization before other scripts