The regex in the googleanalytics.js that determines whether or not a click is a download only matches if the file extension is at the end of the HREF. If you have any variables in the HREF (e.g. - files/some_great_file.txt?token=1234), this will never match, so the click won't count as a download. I've created a patch that I'm using to get around this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Version: 7.x-1.4 » 8.x-2.x-dev
Status: Active » Needs work

The regex of Drupal.googleanalytics.isDownload function should handle this I think.

  • Commit 678a586 on 7.x-2.x by hass:
    Issue #2238129: Download events aren't tracked if there are any URL...

  • Commit 096e812 on 8.x-2.x by hass:
    Issue #2238129: Download events aren't tracked if there are any URL...
hass’s picture

Version: 8.x-2.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
858 bytes
858 bytes

Patches attached for 7.x-1.x and 6.x-3.x.

hass’s picture

Status: Needs review » Needs work
hass’s picture

hass’s picture

Status: Needs work » Needs review
hass’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
FileSize
859 bytes
hass’s picture

@rael9: Have you tried the patches?

rael9’s picture

Unfortunately I haven't had an opportunity to try your official patches yet. I wasn't able to get them into our previous dev cycle, so I'm still running with my patch. I will try to get the official version into the next dev cycle and let you know how I fare.

hass’s picture

Status: Needs review » Closed (won't fix)

1.x has reached end of live. No backport planed.