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

Add registration tracking events for .eth and TLD (.box) funnel #840

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

nhohb
Copy link
Collaborator

@nhohb nhohb commented Aug 30, 2024

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Aug 30, 2024

Deploying ens-app-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 78eb780
Status: ✅  Deploy successful!
Preview URL: https://ca6bf95b.ens-app-v3.pages.dev
Branch Preview URL: https://feat-fet-1177-add-registrati.ens-app-v3.pages.dev

View logs

next.config.mjs Outdated Show resolved Hide resolved
src/hooks/useRegistrationEventTracker.ts Outdated Show resolved Hide resolved
next.config.mjs Outdated Show resolved Hide resolved
src/pages/index.tsx Outdated Show resolved Hide resolved
…pened and finish wallet opened tracking events
@nhohb nhohb changed the title Add registration tracking events for .eth funnel Add registration tracking events for .eth and TLD (.box) funnel Sep 5, 2024
Copy link
Collaborator

@storywithoutend storywithoutend left a comment

Choose a reason for hiding this comment

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

2 tests to add:

  • e2e/specs/stateful/box.spec.ts: Add a new file that follows the dot box registration and fires the tracking events.
  • e2e/specs/stateless/registerName [line 160] add a check that search_selected_eth is not fired from this search input.

Also. I know we haven't done this a lot but the registerName tests are starting to get really big so can you wrap your expect code with test.step('should fire tracking event: ', () => {...}?

e2e/specs/stateless/registerName.spec.ts Show resolved Hide resolved
customProperties: { name: text },
})
}

const path = getRouteForSearchItem({ address, chainId, queryClient, selectedItem })
Copy link
Collaborator

Choose a reason for hiding this comment

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

If directing to .box registration page, path should be /dotbox/{name}. If directing to .eth registration page, path should be /register/{name}. Use this to fire the correct search_selected_[eth|box] event.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@storywithoutend
I've implemented your suggestion, but I'm encountering an issue. When a user enters a keyword and immediately presses Enter, the path always resolves to /profile/{name} instead of /register/{name}.

I believe the ownerData variable is undefined because getCachedQueryData isn't returning data in time.

To address this, I've added a waitForTimeout in e2e/specs/stateless/registerName.spec.ts and included a comment explaining the reason.

Please review these changes and let me know if you have any further feedback.

@@ -140,6 +142,8 @@ const Transactions = ({ registrationData, name, callback, onStart }: Props) => {
autoClose: true,
resumeLink: `/register/${name}`,
})

trackEvent({ eventName: 'register_started' })
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's 2 register_started events. Can you double check if both are needed? This is why I suggested that we clear the events variable and check if the event has been called multiple times in registerName.spec.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've analyzed the flow and determined the following:

  • If a user completes a commit transaction, the registerTx variable will be undefined.
    The makeRegisterNameFlow function will be called.

  • If the user refreshes the page, the registerTx variable will have a value, and the showRegisterTransaction function will be called.

Only want to fire this event if the name is available by reading path variable
})

const events: string[] = []
page.on('console', (msg) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we turn this into a fixture? I think it will be useful to use in the future.

const referrer = getUtm()

const props = referrer ? { ...customProperties, referrer } : customProperties
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we need referrer ? {} : {}, we can just pass { ...customProperties, referrer}

Copy link

sonarcloud bot commented Sep 20, 2024

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.

3 participants