Track all outbound links in Google Analytics

前端 未结 7 1809
小蘑菇
小蘑菇 2021-01-31 20:06

I\'ve been using a script to track outbound links for a couple of months now. The script WORKS, but in the report generated by Google Analytics many UR

相关标签:
7条回答
  • 2021-01-31 21:12

    The reason for the :80 in your output is because of e.currentTarget.host

    http://www.w3schools.com/jsref/prop_area_host.asp

    I'm not sure why you are tracking that in addition to your already functional url variable, but you can always insure that :80 is not there with a simple string replace

    _gat._getTrackerByName()._trackEvent("Outbound Links", e.currentTarget.host.replace(':80',''), url, 0);

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