rateltalk
V2EX  ›  Google

谷歌 Google Adwords 新版 GA 事件跟踪 gtag 代码怎么做啊?

  •  
  •   rateltalk · Nov 2, 2017 · 8912 views
    This topic created in 3139 days ago, the information mentioned may be changed or developed.

    这是我新的 GA 统计代码:

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-92sd40dfd-2"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'UA-92624089-2');
    </script>
    

    这是我写的 gtag 事件跟踪:

    <script type="text/javascript">
    	window.addEventListener('load', function() {
            jQuery('[href="mailto:[email protected]"]').click(function(){
                gtag('event', 'E-mail', {
                    'event_action': 'click'
                });
            });
    
            jQuery('#submit').on('click', function(){
                gtag('event', 'InquiryProduct', {
                    'event_action': 'click'
                });
            });
    
        })
    </script>
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2855 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:48 · PVG 15:48 · LAX 00:48 · JFK 03:48
    ♥ Do have faith in what you're doing.