• Resolved ronaldlauweb

    (@ronaldlauweb)


    Hi, how can I convert this to AMP, Please?

    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-35"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'AW-xxxxxxx');
      gtag('config', 'UA-xxxxxxx-35');
    </script>
    <!-- End Global site tag (gtag.js) - Google Analytics -->
    
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-xxxxxxx');
    
    </script>
    <!-- End Google Tag Manager -->
    
    <!--Conversion-->
    <script>
    function gtag_report_conversion(url) {
      var callback = function () {
        if (typeof(url) != 'undefined') {
          window.location = url;
        }
      };
      gtag('event', 'conversion', {
          'send_to': 'AW-xxxxxxx/xxxxxxx_YC',
          'event_callback': callback
      });
      return false;
    }
    </script>
    <!--End Conversion-->
    
    <!--Conversion 2-->
    <script>
    function gtag_report_conversion2(url) {
      var callback = function () {
        if (typeof(url) != 'undefined') {
          window.location = url;
        }
      };
      gtag('event', 'conversion', {
          'send_to': 'AW-yyyyyyyy/yyyyyyyy',
          'event_callback': callback
      });
      return false;
    }
    </script>
    <!--End Conversion 2-->

    I have only added this code

    {
        "vars": {
            "account": "UA-xxxxxxx-35"
        },
        "triggers": {
            "trackPageview": {
                "on": "visible",
                "request": "pageview"
            }
        }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Google tracking AMP’ is closed to new replies.