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: ga and sentry tracking #754

Merged
merged 3 commits into from
Oct 21, 2020
Merged

feat: ga and sentry tracking #754

merged 3 commits into from
Oct 21, 2020

Conversation

Oxiang
Copy link
Contributor

@Oxiang Oxiang commented Oct 20, 2020

Problem

To understand user's behaviour, we need to track their actions for both success and error cases with Google Analytics (GA) and Sentry IO

This closes #700

Solution

Send pageview hit to GA on page change
Send event hit to GA on click or state change, for both success and error cases
Send event hit to Sentry on state change for error cases

Error cases will be send to both GA and Sentry for experimentation

New dependencies:

  • react-ga

Features:

New endpoint to send GA id over to client for react-ga initialisation

GA pageviews:

  • home page
  • email login page
  • otp login page
  • link analytics device page
  • link analytics clicks page
  • link analytics traffic page
  • create link modal page

GA events:

  • enter home page
  • enter login page to fill email
  • enter login page to fill otp
  • enter user page
  • click on file tab in create link modal
  • click on url tab in create link modal
  • click on 'create link' button
  • create link with file
  • create link with url
  • click and view device tab in drawer
  • click and view clicks tab in drawer
  • click and view traffic tab in drawer
  • successfully generate qr code for either svg or png
  • click on download links button
  • search queries
  • unsuccessful otp verification
  • unsuccessful creation of link with url
  • unsuccessful creation of link with file
  • unsuccessful transfer of link ownership
  • unsuccessful generation of qr code
  • unable to download links
  • unable to fetch analytics data

Sentry events:

  • unsuccessful otp verification
  • unsuccessful creation of link with url
  • unsuccessful creation of link with file
  • unsuccessful transfer of link ownership
  • unsuccessful generation of qr code
  • unable to download links
  • unable to fetch analytics data

pageviews for time on page tracking
- home page
- email login page
- otp login page
- link analytics device page
- link analytics clicks page
- link analytics traffic page
- create link modal page

events for behaviour flow
- enter home page
- enter login page to fill email
- enter login page to till otp
- enter user page
- click on file tab in create link modal
- click on url tab in create link modal
- click on 'create link' button
- create link with file
- create link with url
- click and view device tab in drawer
- click and view clicks tab in drawer
- click and view traffic tab in drawer
- successfully generate qr code for either svg or png
- click on download links button
- search queries

feat: new endpoint for ga id

- add new endpoint to provide ga id
- remove ga id from webpack
- initialise react ga during function call
- remove react ga initialisation in index

feat: track error cases

track error cases using both sentry io and google analytics
- unsuccessful otp verification
- unsuccessful creation of link with url
- unsuccessful creation of link with file
- unsuccessful transfer of link ownership
- unsuccessful generation of qr code
- unable to download links
- unable to fetch analytics data
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

No issues otherwise. Thanks for following through!

src/client/actions/gaEvents/index.tsx Outdated Show resolved Hide resolved
src/client/actions/gaEvents/index.tsx Outdated Show resolved Hide resolved
src/client/actions/gaEvents/index.tsx Outdated Show resolved Hide resolved
src/client/actions/user/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

other things I noticed...

src/client/actions/gaEvents/index.tsx Outdated Show resolved Hide resolved
src/client/actions/gaEvents/index.tsx Outdated Show resolved Hide resolved
- change folder path from gaEvents to ga
- rename GAevent to GAEvent
- rename GApageView to GAPageView
- add jsdoc
- change GAEvent category title to lowercase
- retain uppercasing for GAPageView to distinguish it from transition page
@Oxiang Oxiang requested a review from LoneRifle October 21, 2020 02:16
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

lgtm otherwise

src/client/actions/ga/index.tsx Outdated Show resolved Hide resolved
@Oxiang Oxiang merged commit d7be1ec into develop Oct 21, 2020
@Oxiang Oxiang deleted the ga-tracking branch October 21, 2020 05:49
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.

Tracking error metrics
2 participants