Skip to content

Instantly share code, notes, and snippets.

@AertHulsebos
Last active September 11, 2024 22:29
Show Gist options
  • Save AertHulsebos/efc1923931ba1afc47d2510af769a69e to your computer and use it in GitHub Desktop.
Save AertHulsebos/efc1923931ba1afc47d2510af769a69e to your computer and use it in GitHub Desktop.
(() => {
l = s => s == undefined ? "" : s ? "granted" : "denied";
c = s => s == "granted" ? "color: #29b6f6": "color: #C00";
if (!"google_tag_data" in window) {
console.log("No Consent Mode data found, please check your Complianz settings.");
return;
}
var g = google_tag_data.ics.entries, i = "", t = "", u = "";
for (var a in g) {
i = l(g[a]['initial']);
u = l(g[a]['update']);
if (i == "" && u == "") continue;
t = ("\t" + a + ":" +
(i != "" ? "\n\t\tDefault: %c" + i : "%c") + "%c" +
(u != "" ? "\n\t\tUpdate: %c" + u : "%c"));
console.log(t, i != "" ? c(i) : "", "", u != "" ? c(u) : "", "");
}
if (i == "") console.log("");
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment