-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Scorecards] Added click tracking for graphics #692
Conversation
@zarino thanks for all the help when creating the issue. I'm not sure how to test it though, I added some console logs before to check if we were gathering correctly the params, event name and callbacks, and it seems to be working fine. I split the fileType and imgRatio, but we could have merged those two together, I think because they are two separate things it makes sense to keep them separate, but I'm not to fuzzy about either option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lucascumsille! A couple of small comments inline.
Although—crazy thought—I wonder whether we even need to be recording section
, fileType
and imgRatio
separately, when we could just track the URL of the image the user is downloading? 🤔 Wonder whether that might be simpler.
If you want to test this out, you should theoretically be able to do it by putting a valid Google Analytics Gtag ID (doesn’t matter which, can be a live account, GA will ignore the events because they’re not coming from the right domain) into a GOOGLE_ANALYTICS_SCORECARDS
environment variable in your .env
file, and then using a browser extension like this to intercept/log the gtag
calls (or, without an extension, you’ll still be able to see the calls being made, as Network requests, in your built-in browser tools).
Thanks for the feedback @zarino 🙌 Regarding the following comments:
I thought we were making the split between the different properties because it had an impact for the person checking the clicks, but if it doesn't have any practical benefit then I would go for the simple solution. Let me know if you have any preference regarding this.
Good point! I tried finding how we pull the section codes on a section page, I couldn't find anything there, except by the |
My instinct is simpler is better. There won’t be a huge number of events here, and if somebody really wanted to split out the filetypes and aspect ratios, they could do it from the image URLs. But maybe check that just recording the URLs of the images, and how often they’ve been downloaded, is good enough for CEUK? Since they’re the ones that asked for the tracking in the first place :-) |
@zarino at the end we will be using only the url as parameter, considering that it also displays:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🎉
Closed via 97b851c |
Fixes: #688
We are tracking: