Skip to content
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

feat: google analytics for drop-off statistics #192

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Conversation

kylerwsm
Copy link
Contributor

@kylerwsm kylerwsm commented Jun 15, 2020

Problem

Make use of Google Analytics to measure drop-offs that might occur with the introduction of the transition page.

Closes #95.

Solution

I have made use of event logging in Google Analytics.

I named this event which is focused on TransitionPage as transition-page. There are three possible event actions in this Event:

  1. served - Logged by the server when serving a transition page.
  2. loaded - Logged by the user after rendering the transition page.
  3. proceeded - Logged by the user when the proceed button is clicked.

GA logging on the TransitionPage is done using analytics.js gtag.js.

In this configuration, realtime statistics can be view under Reports > Realtime > Events.

Tested on:

  • Local development
  • Staging, on links
  • Staging, on files

Improvements:

  • The googleAnalytics directory is refactored into Services.

@liangyuanruo liangyuanruo requested a review from yong-jie June 15, 2020 17:31
@kylerwsm kylerwsm changed the title Google Analytics to log TransitionPage drop-off feat: google analytics for drop-off statistics Jun 16, 2020
@kylerwsm kylerwsm marked this pull request as ready for review June 16, 2020 09:20
@kylerwsm kylerwsm requested a review from liangyuanruo June 16, 2020 09:20
@JasonChong96
Copy link
Contributor

Would having the client browser send the event to GA directly cause it to be blocked by ad blockers?

@kylerwsm
Copy link
Contributor Author

kylerwsm commented Jun 16, 2020

Would having the client browser send the event to GA directly cause it to be blocked by ad blockers?

That is a good question. Through my manual tests, sending events to GA with my adblocker turned on is still working as intended. If you have tried it, is it also working as intended for you?

To slightly alleviate things, we do have an intermediate loaded event, which might give us insights as to whether the transition page is loading properly, or if events are not sending properly from the users side.

The alternative I can think of right now will be for the transition page to ping our server, so that our server can send the analytics instead. But that could double calls to our servers on every redirects.

@liangyuanruo @yong-jie do you have any inputs on this?

Edit: From my quick research, ad-blockers in general do not block GA. The exceptions are ghostery, and Firefox, which blocks all trackers by default.

@yong-jie
Copy link
Member

Although the approach of routing our tracking requests through our server before sending to GA could solve this problem, I feel like it might be a bit too much development effort for the benefits it provides. Using this bypass might also be deemed unethical(?).

If we're concerned that firefox users could skew our data, would ignoring redirect events coming from firefox help?

@kylerwsm
Copy link
Contributor Author

I agree on the unethical part. I believe we can keep my current implementation, to observe the proportion of users blocking GA first, from the difference in served and loaded events. We might only need a solution if the proportion of untracked users is huge. What do you think?

Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

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

sounds good to me.

@kylerwsm kylerwsm merged commit bc113f8 into develop Jun 17, 2020
@kylerwsm kylerwsm deleted the ga-dropoff branch June 17, 2020 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Google Analytics to measure transition page drop off
4 participants