-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google analytics download event - writing is broken #968
Comments
We should use a css class instead of an id. The class can then be added to any or all links that need to be registered as a download. |
@awead what other links are you thinking of? |
There are some download options related to the fileset. There have been recent discussions to do away with using GA to count downloads because if anyone uses Ghostery or other similar JS blockers, the stats won't get counted. A better way to solve this might be to just count hits to the controller and store them in the database. The table is already there, I believe. However, this work should be separate from this ticket. Just adding |
I don't think GA should be entirely circumvented; lots of people will want to integrate into their existing GA infrastructure. If you want to use the controller, we should write directly to GA from there, e.g. using staccato as OSU has done: https://github.com/osulp/Scholars-Archive/pull/310/files But yes, this should be another issue. |
There's an analytics working group forming now. I'd wait and see what they report back with. |
I'm hesitant to hang up @HackMasterA's bug fix by entangling it with a WG that hasn't been chartered yet. |
In general, GA is not going to be 100% accurate. I think this is probably true of all analytics in one way or another, although it's true you can work around javascript disabling with server-side events. Although if you're using HTTP caching via a CDN or otherwise, which seems especially likely for downloads, it's server-side events that no longer capture properly, while client-side JS is better. In the past and working with others in the industry, I think people usually consider GA's "not exact, may may miss some" to be an education issue, rather than something that can be "fixed". There are diminishing returns trying to "capture everything with 100% reliability and report it exactly accurately", you'll never get there. It may just be a staff education issue -- analytics are inevitably not perfect, they are an estimate. |
@mjgiarlo I wasn't suggesting that. There's two separate issues here: 1) what to do now, and 2) what to do later. The WG should inform the latter issue. In terms of what to do now, I was only suggesting css classes as opposed to ids because there may be multiple download links in a page. But, I won't hold up this PR over that. |
1 similar comment
@mjgiarlo I wasn't suggesting that. There's two separate issues here: 1) what to do now, and 2) what to do later. The WG should inform the latter issue. In terms of what to do now, I was only suggesting css classes as opposed to ids because there may be multiple download links in a page. But, I won't hold up this PR over that. |
Ah, I misunderstood -- the tyranny of trying to catch up on all the things before 🍵. Thanks, @awead! |
The javascript that sends an event to google to register looks for an id that no longer exists in the view code. It also looks for a data: label that is no longer there:
https://github.com/projecthydra-labs/hyrax/blob/master/app/assets/javascripts/hyrax/ga_events.js
These need to be added to the
link_to hyrax.download_path
of each file in https://github.com/projecthydra-labs/hyrax/tree/master/app/views/hyrax/file_sets/media_displayThe text was updated successfully, but these errors were encountered: