Skip to content

Add analytics w/ page views via Countly #257

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

Merged
merged 2 commits into from
Jul 16, 2019
Merged

Add analytics w/ page views via Countly #257

merged 2 commits into from
Jul 16, 2019

Conversation

terichadbourne
Copy link
Member

This PR adds tracking via Countly (hosted at countly.ipfs.io) while respecting "do not track" requests in the user agent.

It taps into Vue's routing system to allow us to see the path for any resource that has its own path, such as tutorial landing pages and individual lessons:
image

This PR also removes tracking via Google Analytics. (Will this cause any problems for you, @mikeal?)

This PR does not address event tracking, such as clicks on "reset code," "view solution," or "submit" buttons within lessons. We'll plan to address that in a second PR once this is in place.

Note: If testing on localhost, you'll need to comment out line 70 in index.html (which restricts tracking to views of the live website) and uncomment line 65 (which tracks views on localhost as well).

Pair programmed by @olizilla & @terichadbourne

@terichadbourne
Copy link
Member Author

Closes #179

@terichadbourne terichadbourne requested a review from fsdiogo July 10, 2019 18:25
@terichadbourne terichadbourne marked this pull request as ready for review July 10, 2019 18:25
@terichadbourne terichadbourne changed the title WIP: Add analytics via Countly Add analytics w/ page views via Countly Jul 10, 2019
@terichadbourne
Copy link
Member Author

@olizilla You mentioned something about potential cross-site issues with Safari. Should I run on localhost in Safari as the test for this and see if Countly catches my views?

Was there something we need to do to check for when there's no Countly to reference? (Or maybe that's already dealt with by the order of the code?)

Copy link
Collaborator

@fsdiogo fsdiogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@terichadbourne
Copy link
Member Author

@olizilla I tried testing from Safari and no page views are registered. If I understood you correctly, this is because we're hosting the Countly instance on ipfs.io instead of proto.school, right? How much work would it be to create a separate instance on the other domain? I went to our existing Google Analytics and see that 16% of our visits over the past month (18% since launch) have come from Safari, so it's a reasonably sized chunk of data we'd be missing, including anyone who receives a link to ProtoSchool on Twitter or otherwise on an iPhone and clicks directly rather than making an effort to open their favorite browser. Should we plan on moving the Countly hosting? Perhaps we adjust this PR to keep GA enabled until that change is made?

@terichadbourne
Copy link
Member Author

@olizilla helped me figure out why my Safari visits weren't being tracked, and the setup is actually okay as is. After we merge we'll need to test again from Firefox to confirm the cross-site tracking is working (since there's an exception for localhost). If it's not, we'll need to host Countly on proto.school instead of ipfs.io.

@terichadbourne terichadbourne merged commit 0ed92aa into code Jul 16, 2019
@terichadbourne terichadbourne deleted the feat/countly branch July 16, 2019 16:10
@terichadbourne terichadbourne added the docs-ipfs In scope for IPFS Docs Working Group label Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-ipfs In scope for IPFS Docs Working Group
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants