Skip to content

Commit

Permalink
Combine config and consent (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodruiz authored Nov 11, 2024
1 parent 62601da commit cfa5393
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
15 changes: 6 additions & 9 deletions docs/_static/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,14 @@ function initializeGoogleAnalytics() {
'gtag'
);

// Set consent status
gtag('consent', 'update', {
'ad_user_data': 'granted',
'ad_storage': 'granted',
'analytics_storage': 'granted'
});
console.log("Consent status updated.");

gtag('js', new Date());
console.log("gtag('js', new Date()) called.");

gtag('config', 'G-JK8T9PJNL0');
// Configure ID and consent
gtag('config', 'G-JK8T9PJNL0', {
'ad_user_data': 'granted',
'ad_storage': 'granted',
'analytics_storage': 'granted'
});
console.log("gtag('config', 'G-JK8T9PJNL0') called.");
}
15 changes: 6 additions & 9 deletions source/_static/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,14 @@ function initializeGoogleAnalytics() {
'gtag'
);

// Set consent status
gtag('consent', 'update', {
'ad_user_data': 'granted',
'ad_storage': 'granted',
'analytics_storage': 'granted'
});
console.log("Consent status updated.");

gtag('js', new Date());
console.log("gtag('js', new Date()) called.");

gtag('config', 'G-JK8T9PJNL0');
// Configure ID and consent
gtag('config', 'G-JK8T9PJNL0', {
'ad_user_data': 'granted',
'ad_storage': 'granted',
'analytics_storage': 'granted'
});
console.log("gtag('config', 'G-JK8T9PJNL0') called.");
}

0 comments on commit cfa5393

Please sign in to comment.