Home Forums Themes Support Claue Google analytic

Topic Resolution: Resolved
Viewing 1 reply thread
  • Author
    Posts
    • #10879

      Hi,

      I would lile to know if my script google analytic is ok like this with no tags:

      async src=”https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxxx”
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments)};
      gtag(‘js’, new Date());

      gtag(‘config’, ‘UA-xxxxxxxxx’);

      How to test if my script is ok

      Thanks

       

       

       

       

    • #10884

      Hi Stephane,

      The correct code format is

      window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments)};
        gtag('js', new Date());
      
        gtag('config', 'UA-76959356-4');
      

      If you use plugin i suggest you can put full code

      
      <script async src="https://www.googletagmanager.com/gtag/js?id=UA-76959356-4"></script>
      <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments)};
        gtag('js', new Date());
      
        gtag('config', 'UA-76959356-4');
      </script>
      
      

      Best regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 1 reply thread

You must be logged in to reply to this topic.