Google Analytics Async: Events Tracking Callback?

前端 未结 3 2099
伪装坚强ぢ
伪装坚强ぢ 2020-12-16 15:58

I wish to use event tracking to record clicks on a specific type of link to another website. I am using jQuery, and the code I currently have is:

$(\'a.websi         


        
相关标签:
3条回答
  • 2020-12-16 16:29

    Use Google Analytics hitCallback

    You can set a custom callback on the tracker object by using:

    _gaq.push(['_set', 'hitCallback', function(){}]);
    

    I described the code for it a little more in-depth here: Track event in Google Analytics upon clicking form submit

    0 讨论(0)
  • 2020-12-16 16:33

    How about solution from this answer?

      // Log a pageview to GA for a conversion
      _gaq.push(['_trackPageview', url]);
      // Push the redirect to make sure it happens AFTER we track the pageview
      _gaq.push(function() { document.location = url; });
    
    0 讨论(0)
  • 2020-12-16 16:42

    I've faced similar issue with the external link tracking. My salvation was using OnMouseDown event instead of OnClick.

    0 讨论(0)
提交回复
热议问题