This commit is contained in:
2025-05-03 20:57:47 -03:00
parent 03e552089a
commit 2b1278281b
3 changed files with 29 additions and 8 deletions

View File

@@ -1,5 +1,12 @@
import type { CookieConsentConfig } from "vanilla-cookieconsent";
declare global {
interface Window {
dataLayer: Record<string, any>[];
gtag: (...args: any[]) => void;
}
}
export const config: CookieConsentConfig = {
guiOptions: {
consentModal: {
@@ -26,6 +33,19 @@ export const config: CookieConsentConfig = {
ga4: {
label:
'<a href="https://marketingplatform.google.com/about/analytics/terms/br/" target="_blank">Google Analytics 4</a>',
onAccept: () => {
console.log("ga4 accepted");
window.gtag("consent", "update", {
ad_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted",
analytics_storage: "granted",
});
},
onReject: () => {
console.log("ga4 rejected");
},
cookies: [
{
name: /^(_ga|_gid)/,
@@ -47,8 +67,7 @@ export const config: CookieConsentConfig = {
acceptAllBtn: "Aceitar todos",
acceptNecessaryBtn: "Rejeitar todos",
showPreferencesBtn: "Gerenciar preferências",
// footer:
// '<a href="#link">Privacy Policy</a>\n<a href="#link">Terms and conditions</a>',
// footer: '<a href="#link">Política de Privacidade</a>\n<a href="#link">Termos e condições</a>',
},
preferencesModal: {
title: "Centro de Preferências de Consentimento",