Skip to content

Instantly share code, notes, and snippets.

View stefanatcroud's full-sized avatar

Stefan Holmes stefanatcroud

View GitHub Profile
@stefanatcroud
stefanatcroud / CMAPI_Integration.js
Last active November 24, 2023 11:07 — forked from shadybones/CMAPI_Integration.js
Enable TrustArc integrations. Sends a "TrustArc Consent" data layer event, which contains "trustarc.consent" as a string indicating each consent status, much like how OneTrust reports consent updates.
<script>
var __i__ = self.postMessage && setInterval(function () {
if (self.PrivacyManagerAPI && __i__) {
var apiObject = {
PrivacyManagerAPI:
{
action: "getConsentDecision",
timestamp: new Date().getTime(),
self: self.location.host
}