开发者

track download with asynchronous google tracking doesn't load google's gif

I tracking a download of a pdf with this code:

_gaq.push(['_trackPageview', trackLink]);

When I check the net console (firebug), it tries to load the google gif for tracking, bu开发者_JAVA技巧t doesn't get loaded, see screendump here: http://screencast.com/t/MWVkZTU0OD

If I copy the url for the tracker and call it directly in the browser, it works:


The root of the problem maybe in that the request to the google gif is interrupted because the browser navigates to the different url (download). Try delaying the download in this way:

<a href="PDF" onclick="that=this; _gaq.push(['_trackEvent','click', 'download', 'pdf'); setTimeout(function(){location.href=that.href;},200);return false;">Download pdf</a>

This will let some time for the analytics script to request the utm.gif.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜