Home > Back-end >  How to install google consent script for CMP banner?
How to install google consent script for CMP banner?

Time:04-30

window.dataLayer = window.dataLayer || [];
function gtag() {
 dataLayer.push(arguments);
}
gtag("consent", "default", {
ad_storage: "Denied",
analytics_storage: "Denied",
wait_for_update: 1000
});
 gtag('set', 'url_passthrough', true);

google consent mode isnt working i'm beginner here thanks in advance for help

CodePudding user response:

use this one

window.dataLayer = window.dataLayer || [];
        function gtag() {
            dataLayer.push(arguments);
        }
        gtag("consent", "default", {
            ad_storage: "denied",
            analytics_storage: "denied",
            wait_for_update: 1000
        });
          gtag('set', 'url_passthrough', true);
          gtag("set", "ads_data_redaction", true);

src content

  • Related