This file contains hidden or 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
| type Config = any; | |
| interface Consent { | |
| preferences: undefined | boolean; | |
| analytics: undefined | boolean; | |
| marketing: undefined | boolean | |
| } | |
| interface Pandectes { |
This file contains hidden or 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
| const COOKIE_NAME = "_pandectes_gdpr"; | |
| const getCookie = (cookieName) => { | |
| const cookieString = document.cookie; | |
| const cookieStart = cookieString.indexOf(cookieName + "="); | |
| if (cookieStart === -1) { | |
| return null; | |
| } | |
| let cookieEnd = cookieString.indexOf(";", cookieStart); | |
| if (cookieEnd === -1) { |
This file contains hidden or 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
| /* START_MODIFY_FOR_YOUR_STORE */ | |
| /* | |
| * Separate with commas if more than one | |
| */ | |
| const GA4_IDS = ""; | |
| const AW_IDS = ""; | |
| /* | |
| * Allow for sending data to the debug console of analytics. | |
| * Only use for a short time to test the implementation. | |
| * Leaving on will not allow events to be included in standard reports. |
This file contains hidden or 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
| /* START_MODIFY_FOR_YOUR_STORE */ | |
| /* | |
| * Separate with commas if more than one | |
| */ | |
| const GA4_IDS = ""; | |
| const AW_IDS = ""; | |
| /* | |
| * Allow for sending data to the debug console of analytics. | |
| * Only use for a short time to test the implementation. | |
| * Leaving on will not allow events to be included in standard reports. |
This file contains hidden or 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
| /* START_MODIFY_FOR_YOUR_STORE */ | |
| /* | |
| * Separate with commas if more than one | |
| */ | |
| const GA4_IDS = ""; | |
| const AW_IDS = ""; | |
| /* | |
| * Allow for sending data to the debug console of analytics. | |
| * Only use for a short time to test the implementation. | |
| * Leaving on will not allow events to be included in standard reports. |
This file contains hidden or 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
| window.dataLayer = window.dataLayer || []; | |
| analytics.subscribe('Pandectes_Consent_Update', function(event) { | |
| /* | |
| event.customData is a json like below: | |
| { | |
| "event": "Pandectes_Consent_Update", | |
| "pandectes_status": "<event_status>", | |
| "pandectes_categories": { | |
| "C0000": "allow", | |
| "C0001": "<category_status>", |
This file contains hidden or 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 initializeReopenTrigger() { | |
| const reopenTrigger = document.querySelectorAll('[href*="#reopenBanner"]'); | |
| if (reopenTrigger.length > 0 && window.Pandectes && window.Pandectes.fn && typeof window.Pandectes.fn.revokeConsent === 'function') { | |
| reopenTrigger.forEach((el) => { | |
| el.onclick = function (e) { | |
| e.preventDefault(); | |
| window.Pandectes.fn.revokeConsent(); | |
| }; | |
| }); |
This file contains hidden or 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
| /* | |
| * DISCLAIMER: | |
| * This example code is provided "as is" and for demonstration purposes only. | |
| * It is intended to serve as a starting point for developers and may contain bugs or errors. | |
| * The author or distributor of this code makes no warranties or representations of any kind concerning the safety, | |
| * suitability, inaccuracies, typographical errors, or other harmful components of this code. | |
| * There is no guarantee that this code is free of defects or bugs. | |
| * | |
| * Please note that this code is subject to change without prior notice. | |
| * Users are encouraged to review the code regularly for any updates or changes. |
This file contains hidden or 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 following lines of code just above </head> in your HTML. HelloRetail will not track any users --> | |
| <script async src="https://helloretailcdn.com/helloretail.js"></script> | |
| <script> | |
| window.hrq = window.hrq || []; | |
| hrq.push(['init', { | |
| trackingOptOut: true | |
| }]); | |
| window.addEventListener('PandectesEvent_OnConsent', function(params){ | |
| if (params && params.detail) { | |
| hrq.push(["setTrackingOptOut", (params.detail.preferences & 4) === 4]); |
NewerOlder