Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

[Analytics] Track overview layout #3606

Merged
merged 17 commits into from
Mar 3, 2022
Merged

Conversation

DiogoSoaress
Copy link
Contributor

What it solves

Resolves partially #3408
Addresses the track in the "Overview" layout

How this PR fixes it

Attaches tracking events to parts of the "Overview" screen as per https://docs.google.com/document/d/1RY9oaRV4x8N0wsWrU1H0O_EpQOn9pmF2wq25l0H-EKc/edit#heading=h.c4txlg1cdztw

How to test it

The clicked buttons shall be firing tags to be read in GTM

Screenshots

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

E2E Tests Passed ✅
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1927174113

<Link to={WELCOME_ROUTE}>
<Img alt="Gnosis Safe" height={36} src={SafeLogo} testId="heading-gnosis-logo" id="safe-logo" />
</Link>
<Track {...SAFE_OVERVIEW_TRACKING_EVENTS.HOME}>
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to track clicks on internal links?
The navigation should be tracked by page views/URL.

Copy link
Member

@usame-algan usame-algan Mar 2, 2022

Choose a reason for hiding this comment

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

That is correct. The information we gain with this is the button that was clicked and the page it was clicked on. If that is not important I suggest we remove explicit tracking for internal links and solely rely on the pageview event. cc @johannesmoormann
Screenshot 2022-03-02 at 12 02 00

Copy link
Member

Choose a reason for hiding this comment

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

We should only track internal links if we want to have the chain data or a payload alongside it.

@@ -103,7 +103,7 @@ export const CurrencyDropdown = ({ testId }: { testId: string }): React.ReactEle
<MenuItem
className={classes.listItem}
key={currencyName}
onClick={() => onCurrentCurrencyChangedHandler(currencyName)}
onClick={() => handleCurrencyChange(currencyName)}
Copy link
Member

Choose a reason for hiding this comment

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

Please don't make unnecessary and unrelated changes like this.

@katspaugh katspaugh changed the title Track overview layout [Analytics] Track overview layout Mar 2, 2022
@usame-algan usame-algan changed the base branch from track-creation to improve-analytics March 2, 2022 08:41
@usame-algan usame-algan changed the base branch from improve-analytics to track-creation March 2, 2022 08:41
Base automatically changed from track-creation to improve-analytics March 2, 2022 11:00
@usame-algan usame-algan marked this pull request as ready for review March 2, 2022 12:48
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Really happy about this. I have a few comments and the tests are failing.

@@ -37,6 +39,7 @@ export const CurrencyDropdown = ({ testId }: { testId: string }): React.ReactEle
)

const handleClick = (event: React.MouseEvent<HTMLElement>) => {
trackEventGTM({ ...SAFE_OVERVIEW_TRACKING_EVENTS.OPEN_CURRENCY_MENU })
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to spread this.

@@ -46,6 +48,9 @@ export const loadIntercom = async (): Promise<void> => {
user_id: intercomUserId,
})
intercomLoaded = true
;(window as any).Intercom('onShow', () => {
Copy link
Member

Choose a reason for hiding this comment

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

You know what I'm gonna say 👀 Maybe we should add an issue for this?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the refactor should be no problem since we did it already for the Beamer object but I didn't want to blow up this PR.

@@ -46,6 +48,9 @@ export const loadIntercom = async (): Promise<void> => {
user_id: intercomUserId,
})
intercomLoaded = true
;(window as any).Intercom('onShow', () => {
trackEventGTM({ ...SAFE_OVERVIEW_TRACKING_EVENTS.OPEN_INTERCOM })
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to spread this.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

👍

…erview-layout

# Conflicts:
#	src/components/AppLayout/Sidebar/SafeHeader/index.tsx
@iamacook iamacook merged commit 5287431 into improve-analytics Mar 3, 2022
@iamacook iamacook deleted the track-overview-layout branch March 3, 2022 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants