Closed (duplicate)
Project:
Google Analytics
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2012 at 12:22 UTC
Updated:
24 Nov 2012 at 23:37 UTC
When i enable the download tracking, the downloads are not logged to analytics.
After some debugging i discovered that the click event ($(document.body).click(function(event) {) is not called, when clicking on a link.
Tested this in firefox.
Comments
Comment #1
hass commentedYou may have disabled download tracking. Otherwise we need an example site with latest version installed where you think it's not working.
Comment #2
hass commentedComment #3
hass commentedComment #4
nils.destoop commentedDownload tracking is enabled.
If i changed code to:
Then everything is working.
This means the listener on links is working, but a listener on document.body is not working (if a link was clicked).
Comment #5
hass commentedThe code worked for past 2 or more years.
Comment #6
hass commentedThis issue is reproducible under Firefox, Chrome works. I can confirm that the tracking pixel is not send to Google in Firebug. The reason seems not the JavaScript itself. With an console.log() I see that all code runs correctly. Only the
_trackEventis not executed or at least it has not enough time to load before an PDF is opened in the same window.Looks like a duplicate of #1580144: Links not tracked in some browsers as jquery click event exits before tracking code finishes.
Comment #7
hass commentedTested Firefox with TXT and PDF (both are not tracked). Tested with MSI download (works). It looks like, if the browser is able to open the download itself internally - tracking fails. If a download/save dialog appears - tracking works.
Your change to A element is invalid and will cause slow unbinding issues, see #336924: Massive page rendering slowdown with many links. Additional it also does not help anything here.
Comment #8
hass commentedChrome seems to have the same issues.
Comment #9
hass commented#1580144: Links not tracked in some browsers as jquery click event exits before tracking code finishes