• Please help (Deutsche anwesend? Mein Englisch ist zum gruseln ^^)

    I will use your php function with google auto ads/analytics, but it doesn’t work in functions.php or header.php.

    Can anyone fix this code please and show me the right part to include it?

    
    if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) {
    <!-- Adsense -->
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({
              google_ad_client: "ca-pub-123456",
              enable_page_level_ads: true
         });
    </script>
    
    <!-- Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-123456-39', 'auto');
      ga('send', 'pageview');
      ga('set', 'anonymizeIp', true);
    
    </script>
    }

    Many thanks ??

    • This topic was modified 6 years, 8 months ago by madloki.
    • This topic was modified 6 years, 8 months ago by madloki.
    • This topic was modified 6 years, 8 months ago by madloki.
    • This topic was modified 6 years, 8 months ago by madloki.
  • The topic ‘Use “cn_cookies_accepted” with google auto ads?’ is closed to new replies.