___TERMS_OF_SERVICE___ By creating or modifying this file you agree to Google Tag Manager's Community Template Gallery Developer Terms of Service available at https://developers.google.com/tag-manager/gallery-tos (or such other URL as Google may provide), as modified from time to time. ___INFO___ { "type": "TAG", "id": "cvt_K8GSG", "__wm": "VGVtcGFsdGUtQXV0aG9yX0NvbnNlbnRNb2RlLVNpbW8tQWhhdmE\u003d", "version": 1, "displayName": "Consent Mode (Google + Microsoft tags)", "categories": [ "UTILITY", "ANALYTICS", "ADVERTISING" ], "brand": { "id": "github.com_gtm-templates-simo-ahava", "displayName": "gtm-templates-simo-ahava", "thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA7tAAAO7QHxzsUOAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAuVQTFRF////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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XvPLgi7uArvwbmHR2DP9DuqwnRZXD10RXGEhd0Yp26qy3gkTizOzryvY/PacH72iL9h6zsHPj39m2iLWnKDwik3PMRlcGrPv5Ys8JyV2w9LWUs+Vmm0PUo5MIpcxTfiZ2PJjSJf9UOaE9Zg0Q2ipKPyI5eUAiy7OYzWcOx6Ow4DjOHjOB2fXsZh4Q1hr54b7+LnYemN4OhNuk5g5GLxDeBUZ22nsJK3YPn1fwDorfEkZt2dEKCbh7Wexm60Fwb0MobpJfUwHOjkFe2XstoegwV9vBunPQB280F40MUMIx7F1Oy/MKGH5w25oaHBNrjQQOljxtzSUnsDdCinuC8zh2pLIUQxx7sZdVtbwmwoUcrBW5lhZJyCFXX883Lz7m1tvRteVPFSJWYgtRbBjBKO3MvMJPbkadihZ2sTc7/i0C4PfsjP/lVhBlNnFu4UJOX7nsxwbvsCluhO/kyw4JeZEzILYYqG3GZ2fNmx/ly4ImBfX2YNnT+HL8kUTanJbKLHOjiTSOEE+36JL/0jeJPEwaftfLzSjfPwmVACeZlJzFaaZe+BwEicXtbX7uesxtJm4L7h0HyW4cLj9hN7vl8El8HZMfpK5go1umdvwIWiAOydM6Q5c4ykzmNXn4Taivludv8mzFGqtOo14vVVefhwUCbH/z1/0qCOKcx9qqX27JcxfNyUme8s/HSl3+R++Pc3X8kePfShvmkpMQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI8T/pByEHqDxYVAAAAABJRU5ErkJggg\u003d\u003d" }, "description": "Adjust tag behavior based on consent. This template utilizes the Consent API and can be used to adjust how Microsoft and Google\u0027s advertising tools use cookies and process ad identifiers.", "containerContexts": [ "WEB" ], "securityGroups": [] } ___TEMPLATE_PARAMETERS___ [ { "type": "SELECT", "name": "command", "displayName": "Consent Command", "selectItems": [ { "value": "default", "displayValue": "Default" }, { "value": "update", "displayValue": "Update" } ], "simpleValueType": true, "help": "\u003cstrong\u003eDefault\u003c/strong\u003e means that you establish consent settings the site falls back on until such a time that the Update command is executed. You can have multiple Default tags on the page, each corresponding to a different region, for example.\n\u003cstrong\u003eUpdate\u003c/strong\u003e is what you\u0027d use once you\u0027ve retrieved a consent status from the user.", "defaultValue": "default", "alwaysInSummary": true }, { "type": "TEXT", "name": "wait_for_update", "displayName": "Wait for Update", "simpleValueType": true, "valueUnit": "milliseconds", "defaultValue": 0, "help": "How long to wait (in milliseconds) for an \u003cstrong\u003eUpdate\u003c/strong\u003e command before firing Google tags that have been queued up.", "enablingConditions": [ { "paramName": "command", "paramValue": "default", "type": "EQUALS" } ], "valueValidators": [ { "type": "NON_NEGATIVE_NUMBER" } ] }, { "type": "CHECKBOX", "name": "eea", "checkboxText": "Include EEA regions", "simpleValueType": true, "help": "Check this box to apply this tag only to visitors from the European Economic Area.", "defaultValue": false, "enablingConditions": [ { "paramName": "command", "paramValue": "default", "type": "EQUALS" } ] }, { "type": "TEXT", "name": "regions", "displayName": "Regions", "simpleValueType": true, "defaultValue": "all", "help": "Apply this setting to users from these \u003ca href\u003d\"https://en.wikipedia.org/wiki/ISO_3166-2\"\u003eregions\u003c/a\u003e (provide a comma-separated list). If you type \u003cstrong\u003eall\u003c/strong\u003e, the setting will apply to all users. If you type \u003cstrong\u003eeea\u003c/strong\u003e as one of the regions, the tag will automatically include all European Economic Area regions as geographical targets for this command.", "enablingConditions": [ { "paramName": "eea", "paramValue": false, "type": "EQUALS" } ], "valueValidators": [ { "type": "NON_EMPTY", "errorMessage": "Set to \"all\" for all regions or add a comma-separated list of regions." } ] }, { "type": "TEXT", "name": "regionsEEA", "displayName": "Regions", "simpleValueType": true, "defaultValue": "eea", "help": "Apply this setting to users from these \u003ca href\u003d\"https://en.wikipedia.org/wiki/ISO_3166-2\"\u003eregions\u003c/a\u003e (provide a comma-separated list). If you type \u003cstrong\u003eall\u003c/strong\u003e, the setting will apply to all users. If you type \u003cstrong\u003eeea\u003c/strong\u003e as one of the regions, the tag will automatically include all European Economic Area regions as geographical targets for this command.", "enablingConditions": [ { "paramName": "eea", "paramValue": true, "type": "EQUALS" } ], "valueValidators": [ { "type": "NON_EMPTY", "errorMessage": "Set to \"all\" for all regions or add a comma-separated list of regions." } ] }, { "type": "CHECKBOX", "name": "platform_microsoft", "checkboxText": "Enable Microsoft Consent Mode (Clarity + Bing)", "simpleValueType": true, "alwaysInSummary": false, "defaultValue": false, "help": "If checked, this tag also sets consent signals for Clarity and Bing." }, { "type": "GROUP", "name": "settings", "displayName": "Consent Settings", "groupStyle": "ZIPPY_OPEN", "subParams": [ { "type": "GROUP", "name": "require_both", "displayName": "Required for Microsoft and Google services", "groupStyle": "NO_ZIPPY", "subParams": [ { "type": "SELECT", "name": "ad_storage", "displayName": "ad_storage", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied", "help": "If set to \u003cstrong\u003edenied\u003c/strong\u003e, Google and Microsoft\u0027s tags and pixels will not be able to read or write first-party cookies. The use of third-party cookies is limited to only spam and fraud detection purposes. \u003ca href\u003d\"https://support.google.com/analytics/answer/9976101#behavior\"\u003eMore information\u003c/a\u003e." }, { "type": "SELECT", "name": "analytics_storage", "displayName": "analytics_storage", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied", "help": "If set to \u003cstrong\u003edenied\u003c/strong\u003e, Google Analytics and Microsoft Clarity tags will not read or write analytics cookies, and data collected to Google Analytics will not utilize persistent cookie identifiers (the identifiers are reset with every page load). \u003ca href\u003d\"https://support.google.com/analytics/answer/9976101#behavior\"\u003eMore information\u003c/a\u003e." } ] }, { "type": "GROUP", "name": "required_google", "displayName": "Required for Google services", "groupStyle": "NO_ZIPPY", "subParams": [ { "type": "SELECT", "name": "ad_user_data", "displayName": "ad_user_data", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied", "help": "If set to \u003cstrong\u003edenied\u003c/strong\u003e, user data cannot be used with Google\u0027s advertising solutions for audience building." }, { "type": "SELECT", "name": "ad_personalization", "displayName": "ad_personalization", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied", "help": "If set to \u003cstrong\u003edenied\u003c/strong\u003e, data collected on this website will not be used for remarketing in Google\u0027s advertising solutions." } ] }, { "type": "GROUP", "name": "optional", "displayName": "Other signals", "groupStyle": "NO_ZIPPY", "subParams": [ { "type": "SELECT", "name": "personalization_storage", "displayName": "personalization_storage", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied" }, { "type": "SELECT", "name": "functionality_storage", "displayName": "functionality_storage", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied" }, { "type": "SELECT", "name": "security_storage", "displayName": "security_storage", "macrosInSelect": true, "selectItems": [ { "value": "granted", "displayValue": "granted" }, { "value": "denied", "displayValue": "denied" }, { "value": "notset", "displayValue": "Not set" } ], "simpleValueType": true, "defaultValue": "denied" } ] } ] }, { "type": "GROUP", "name": "other", "displayName": "Other Settings", "groupStyle": "ZIPPY_OPEN", "subParams": [ { "type": "CHECKBOX", "name": "url_passthrough", "checkboxText": "Pass Ad Click Information Through URLs (url_passthrough)", "simpleValueType": true, "help": "Check this if you want internal links to pass advertising identifiers (\u003cstrong\u003egclid\u003c/strong\u003e, \u003cstrong\u003edclid\u003c/strong\u003e, \u003cstrong\u003egclsrc\u003c/strong\u003e, \u003cstrong\u003e_gl\u003c/strong\u003e, \u003cstrong\u003ewbraid\u003c/strong\u003e) in the link URL while waiting for consent to be granted. \u003ca href\u003d\"https://developers.google.com/tag-platform/security/guides/consent#passthroughs\"\u003eRead more here\u003c/a\u003e." }, { "type": "CHECKBOX", "name": "ads_data_redaction", "checkboxText": "Redact Ads Data (ads_data_redaction)", "simpleValueType": true, "help": "If this is checked \u003cstrong\u003eand\u003c/strong\u003e ad_storage consent status is \u003cstrong\u003edenied\u003c/strong\u003e, Google\u0027s advertising tags will drop all advertising identifiers from the requests, and traffic will be routed through cookieless domains." }, { "type": "CHECKBOX", "name": "sendDataLayer", "checkboxText": "Push dataLayer Event", "simpleValueType": true, "help": "When consent is set to \"default\", a dataLayer event with \u003cstrong\u003eevent: \u0027gtm_consent_default\u0027\u003c/strong\u003e is sent, together with all the consent states. When an \"update\" is fired, a dataLayer event with \u003cstrong\u003eevent: \u0027gtm_consent_update\u0027\u003c/strong\u003e is pushed together with details about the updated consent state." }, { "type": "CHECKBOX", "name": "enableTCF", "checkboxText": "Enable IAB TCF Support For Google Tags", "simpleValueType": true, "help": "If you are using IAB\u0027s Transparency and Consent Framework within your Consent Management Platform, you can check this box. When enabled, this setting automatically maps Google Consent Mode states to IAB TCF purposes. \u003ca href\u003d\"https://developers.google.com/tag-platform/security/guides/implement-TCF-strings#website\" target\u003d\"_blank\"\u003eRead more here\u003c/a\u003e." } ] } ] ___SANDBOXED_JS_FOR_WEB_TEMPLATE___ const callInWindow = require('callInWindow'); const copyFromWindow = require('copyFromWindow'); const createQueue = require('createQueue'); const dataLayerPush = require('createQueue')('dataLayer'); const gtagSet = require('gtagSet'); const log = require('logToConsole'); const makeNumber = require('makeNumber'); const makeTableMap = require('makeTableMap'); const setDefaultConsentState = require('setDefaultConsentState'); const setInWindow = require('setInWindow'); const updateConsentState = require('updateConsentState'); const eeaRegions = [ "AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE", "NO", "IS", "LI" ]; const regions = data.regions || data.regionsEEA; // Determine the command and the setting object const consentApi = data.command === 'default' ? setDefaultConsentState : updateConsentState; const settingsObject = {}; if (data.ad_storage !== 'notset') settingsObject.ad_storage = data.ad_storage; if (data.analytics_storage !== 'notset') settingsObject.analytics_storage = data.analytics_storage; if (data.ad_user_data !== 'notset') settingsObject.ad_user_data = data.ad_user_data; if (data.ad_personalization !== 'notset') settingsObject.ad_personalization = data.ad_personalization; if (data.personalization_storage !== 'notset') settingsObject.personalization_storage = data.personalization_storage; if (data.functionality_storage !== 'notset') settingsObject.functionality_storage = data.functionality_storage; if (data.security_storage !== 'notset') settingsObject.security_storage = data.security_storage; // Settings specific to the "default" command if (data.command === 'default' && makeNumber(data.wait_for_update) > 0) { settingsObject.wait_for_update = makeNumber(data.wait_for_update); } if (data.command === 'default' && regions !== 'all') { let setRegions = regions.split(',').map(r => r.trim()); // Check if EEA regions are included if (setRegions.indexOf('eea') > -1) { setRegions = setRegions.concat(eeaRegions); // Remove duplicates & eea setRegions = setRegions.filter((val, idx) => setRegions.indexOf(val) === idx && val !== 'eea'); } settingsObject.region = setRegions; } // Set advanced settings gtagSet({ url_passthrough: data.url_passthrough || false, ads_data_redaction: data.ads_data_redaction || false }); // Set the consent state consentApi(settingsObject); if (data.platform_microsoft) { const getClarity = () => { const clarity = copyFromWindow('clarity'); if (clarity) return clarity; setInWindow('clarity', function() { callInWindow('clarity.q.push', arguments); }); createQueue('clarity.q'); return copyFromWindow('clarity'); }; const uetq = createQueue('uetq'); uetq('consent', data.command, { 'ad_storage': data.ad_storage }); const clarity = getClarity(); clarity('consentv2', { ad_Storage: data.ad_storage, analytics_Storage: data.analytics_storage }); } // Add TCF integration if (data.enableTCF) { setInWindow('gtag_enable_tcf_support', true, true); } // Push to dataLayer if needed if (data.sendDataLayer) { settingsObject.event = 'gtm_consent_' + data.command; dataLayerPush(settingsObject); } // Call data.gtmOnSuccess when the tag is finished. data.gtmOnSuccess(); ___WEB_PERMISSIONS___ [ { "instance": { "key": { "publicId": "logging", "versionId": "1" }, "param": [ { "key": "environments", "value": { "type": 1, "string": "debug" } } ] }, "clientAnnotations": { "isEditedByUser": true }, "isRequired": true }, { "instance": { "key": { "publicId": "access_globals", "versionId": "1" }, "param": [ { "key": "keys", "value": { "type": 2, "listItem": [ { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "dataLayer" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true }, { "type": 8, "boolean": false } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "uetq" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true }, { "type": 8, "boolean": false } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "clarity" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true }, { "type": 8, "boolean": false } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "clarity.q" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true }, { "type": 8, "boolean": false } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "clarity.q.push" }, { "type": 8, "boolean": false }, { "type": 8, "boolean": false }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "key" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" }, { "type": 1, "string": "execute" } ], "mapValue": [ { "type": 1, "string": "gtag_enable_tcf_support" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true }, { "type": 8, "boolean": false } ] } ] } } ] }, "clientAnnotations": { "isEditedByUser": true }, "isRequired": true }, { "instance": { "key": { "publicId": "access_consent", "versionId": "1" }, "param": [ { "key": "consentTypes", "value": { "type": 2, "listItem": [ { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "ad_storage" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "analytics_storage" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "personalization_storage" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "functionality_storage" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "security_storage" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "ad_user_data" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] }, { "type": 3, "mapKey": [ { "type": 1, "string": "consentType" }, { "type": 1, "string": "read" }, { "type": 1, "string": "write" } ], "mapValue": [ { "type": 1, "string": "ad_personalization" }, { "type": 8, "boolean": true }, { "type": 8, "boolean": true } ] } ] } } ] }, "clientAnnotations": { "isEditedByUser": true }, "isRequired": true }, { "instance": { "key": { "publicId": "write_data_layer", "versionId": "1" }, "param": [ { "key": "keyPatterns", "value": { "type": 2, "listItem": [ { "type": 1, "string": "url_passthrough" }, { "type": 1, "string": "ads_data_redaction" } ] } } ] }, "clientAnnotations": { "isEditedByUser": true }, "isRequired": true } ] ___TESTS___ scenarios: - name: default settings sent code: |- // Call runCode to run the template's code. runCode(mockData); // Verify that the tag finished successfully. assertApi('setDefaultConsentState').wasCalledWith({ analytics_storage: 'denied', ad_user_data: 'granted', ad_personalization: 'denied', personalization_storage: 'denied', functionality_storage: 'denied', security_storage: 'denied', region: ['US-CA'], wait_for_update: 500 }); assertApi('gtmOnSuccess').wasCalled(); - name: updated settings sent code: |- mockData.command = 'update'; // Call runCode to run the template's code. runCode(mockData); // Verify that the tag finished successfully. assertApi('updateConsentState').wasCalledWith({ analytics_storage: 'denied', ad_user_data: 'granted', ad_personalization: 'denied', personalization_storage: 'denied', functionality_storage: 'denied', security_storage: 'denied' }); assertApi('gtmOnSuccess').wasCalled(); - name: extra settings sent code: |- mock('gtagSet', (obj) => { assertThat(obj.url_passthrough).isEqualTo(true); assertThat(obj.ads_data_redaction).isEqualTo(true); }); // Call runCode to run the template's code. runCode(mockData); // Verify that the tag finished successfully. assertApi('gtmOnSuccess').wasCalled(); - name: dataLayer events generated code: "mockData.sendDataLayer = true;\n\nlet dlCalled = false;\n\nmock('createQueue',\ \ name => {\n return o => {\n if (o.event === 'gtm_consent_default' && \n\ \ o.analytics_storage === 'denied' && \n o.ad_user_data === 'granted'\ \ &&\n o.ad_personalization === 'denied' &&\n o.personalization_storage\ \ === 'denied' &&\n o.functionality_storage === 'denied' &&\n o.security_storage\ \ === 'denied' &&\n o.region[0] === 'US-CA') dlCalled = true;\n \n \ \ };\n});\n \n// Call runCode to run the template's code.\nrunCode(mockData);\n\ \n// Verify that the tag finished successfully.\nassertApi('gtmOnSuccess').wasCalled();\n\ assertThat(dlCalled, 'dataLayer not called with correct arguments').isEqualTo(true);" setup: |- const mockData = { platform_google: true, platform_microsoft: true, command: 'default', ad_storage: 'notset', analytics_storage: 'denied', ad_user_data: 'granted', ad_personalization: 'denied', personalization_storage: 'denied', functionality_storage: 'denied', security_storage: 'denied', wait_for_update: 500, regions: 'US-CA', url_passthrough: true, ads_data_redaction: true, sendDataLayer: false, }; ___NOTES___ Created on 13/08/2024, 15:40:09