Skip to content

Commit

Permalink
event listening not needed, provide simple gcm script
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshson committed Jun 4, 2024
1 parent 0e3ffb6 commit 6d925a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion feincms3_cookiecontrol/static/f3cc/gcm.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(()=>{window.dataLayer=window.dataLayer||[];function d(){dataLayer.push(arguments)}function n(a,e){d("consent",a,{ad_user_data:e,ad_personalization:e,ad_storage:e,analytics_storage:e})}n("default","denied");window.addEventListener("f3cc_consent_granted",()=>{n("update","granted")});window.addEventListener("f3cc_consent_denied",()=>{n("update","denied")});})();
(()=>{window.dataLayer=window.dataLayer||[];function a(){dataLayer.push(arguments)}a("consent","default",{ad_user_data:"granted",ad_personalization:"granted",ad_storage:"granted",analytics_storage:"granted"});})();
29 changes: 9 additions & 20 deletions src/gcm.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
window.dataLayer = window.dataLayer || []
function gtag(){dataLayer.push(arguments)}
function setGAConsentData(action, status) {
gtag(
"consent",
action,
{
ad_user_data: status,
ad_personalization: status,
ad_storage: status,
analytics_storage: status,
},
)
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
setGAConsentData("default", "denied")
window.addEventListener("f3cc_consent_granted", () => {
setGAConsentData("update", "granted")
})
window.addEventListener("f3cc_consent_denied", () => {
setGAConsentData("update", "denied")
})
gtag("consent", "default", {
ad_user_data: "granted",
ad_personalization: "granted",
ad_storage: "granted",
analytics_storage: "granted",
});

0 comments on commit 6d925a9

Please sign in to comment.