This commit is contained in:
2025-05-13 13:17:48 -03:00
parent 34c23d9011
commit cfc50fff8c
2 changed files with 16 additions and 16 deletions

View File

@@ -35,17 +35,17 @@ export const config: CookieConsentConfig = {
onAccept: () => {
console.log("ga4 accepted");
window.dataLayer = window.dataLayer || [];
function gtag(...args: any[]) {
window.dataLayer.push(args);
}
// window.dataLayer = window.dataLayer || [];
// function gtag(...args: any[]) {
// window.dataLayer.push(args);
// }
gtag("consent", "update", {
ad_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted",
analytics_storage: "granted",
});
// gtag("consent", "update", {
// ad_storage: "granted",
// ad_user_data: "granted",
// ad_personalization: "granted",
// analytics_storage: "granted",
// });
},
onReject: () => {
console.log("ga4 rejected");

View File

@@ -32,12 +32,12 @@ interface Props extends HeadProps {}
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("consent", "default", {
ad_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied",
analytics_storage: "denied",
});
// gtag("consent", "default", {
// ad_storage: "denied",
// ad_user_data: "denied",
// ad_personalization: "denied",
// analytics_storage: "denied",
// });
gtag("config", "GTM-N3F7P9ZB");
</script>