-
Notifications
You must be signed in to change notification settings - Fork 263
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
Track Theme popularity through Google Analytics #213
base: master
Are you sure you want to change the base?
Conversation
This is a great attempt, but I was more thinking of tracking how many times each theme was viewed as (synthetic) page views. We could track how many times theme colours were copied as well, but tbh that is a secondary concern for me. If we could get https://github.com/googleanalytics/autotrack integrated into the project and start sending out URL Change events as themes are being switched at this point, it would be great. |
@paracycle correct me if I'm wrong, but doesn't googleanalytics/autotrack send GA events at the end of the day? All the relevant events can be dispatched from the I would much prefer this implementation compared to pulling in autotrack, as it is an extra dependency that increases load time etc. tl;dr: with under 10 lines of extra code we can accomplish the things you want without using autotrack. |
Yeah, sure,
I am all for using the built-in What do you think? |
It think it's a great starting point! Just to be clear:
|
Thanks for being so meticulous, I appreciate it. Ideally I would like to capture all view landings as page views, so both browser links (in case people have shared links with their friends) and clicks. The spanner is the works is the initial redirect to the first theme in the list. If we keep counting that, it will skew the results. However, I am not sure how to exclude that first rewrite. Do you think you can take a stab at it? |
I can try 😉 |
@paracycle you should test it locally with your google analytics token configured, but it should work! |
Fixes #50
This solution detects a CTRL+C or CMD+C keypress inside the copy section, and dispatches an event to Google Analytics, where the events can be categorised and such.
This solution is not perfect. Copying events through mouse clicks are not covered, and multiple copy events also trigger multiple GA events. I think that even though these imperfections are there, the data can still show interesting trends through the discrepancies.
Feel free to add feedback @paracycle