Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#10 | Issue-2238129-Download-events-arent-tracked-if-there-D71.patch | 859 bytes | hass |
#8 | Issue-2238129-Download-events-arent-tracked-if-there-D63.patch | 859 bytes | hass |
Comments
Comment #1
hass CreditAttribution: hass commentedThe regex of Drupal.googleanalytics.isDownload function should handle this I think.
Comment #4
hass CreditAttribution: hass commentedPatches attached for 7.x-1.x and 6.x-3.x.
Comment #5
hass CreditAttribution: hass commentedComment #8
hass CreditAttribution: hass commentedComment #9
hass CreditAttribution: hass commentedComment #10
hass CreditAttribution: hass commentedComment #11
hass CreditAttribution: hass commented@rael9: Have you tried the patches?
Comment #12
rael9 CreditAttribution: rael9 commentedUnfortunately 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.
Comment #13
hass CreditAttribution: hass commented1.x has reached end of live. No backport planed.