This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var __i__ = self.postMessage && setInterval(function () { | |
if (self.PrivacyManagerAPI && __i__) { | |
var apiObject = { | |
PrivacyManagerAPI: | |
{ | |
action: "getConsentDecision", | |
timestamp: new Date().getTime(), | |
self: self.location.host | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function () { | |
return google_tag_manager[{{Container ID}}].dataLayer.get("ecommerce.items").map(function(a){return a.item_id}).join("|") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Google Consent Mode V2 --> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('consent', 'default', { | |
ad_storage: 'denied', | |
ad_user_data: 'denied', | |
ad_personalization: 'denied', | |
analytics_storage: 'denied', | |
wait_for_update: 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Google Consent Mode V2 --> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag() { dataLayer.push(arguments); } | |
gtag('consent', 'default', { | |
ad_storage: 'denied', | |
ad_user_data: 'denied', | |
ad_personalization: 'denied', | |
analytics_storage: 'denied', | |
wait_for_update: 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the below as a Custom JavaScript variable in GTM and it will use | |
// the Data Layer Variable "DLV - user_email" as the plaintext email input. | |
// | |
// Output will be a preformatted email address adhering to Google's | |
// requirements for Enhanced Conversions. | |
function() { | |
email = {{DLV - user_email}}.trim().toLowerCase().split('@'); | |
return (email[1] === 'gmail.com' || email[1] === 'googlemail.com') | |
? email[0].replaceAll('.','').split('+')[0] + '@' + email[1] | |
: email[0].split('+')[0] + '@' + email[1] |