Google Analytics _trackEvent doesn't work with XHTML?

后端 未结 1 1561
一生所求
一生所求 2021-01-28 05:31

I have a php file generating XHTML content and I use


at the top of the page to d

相关标签:
1条回答
  • 2021-01-28 05:51

    Have you tried removing the javascript from the inline anchor element and creating a listener which is wrapped in a CDATA tag?

    Example:

    <a id="my_anchor" href="someZip.zip">Click me</a>
    
    <script type="text/javascript">
    /* <![CDATA[ */
    
    // Ensure scope for _gaq ....
    
    // Jquery syntax..
    $('#my_anchor').click(function()
    {
      _gaq.push(['_trackEvent', 'Item', 'Download', 'file-name']);
    });
    
    /* ]]> */
    </script>
    
    0 讨论(0)
提交回复
热议问题