-
Notifications
You must be signed in to change notification settings - Fork 390
feat: [UIE-9805] - Extract EUUID from /profile header and send to Adobe analytics #13229
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
base: develop
Are you sure you want to change the base?
feat: [UIE-9805] - Extract EUUID from /profile header and send to Adobe analytics #13229
Conversation
jdamore-linode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tanushree-akamai, having trouble finding a way to test this, but will continue looking into it tomorrow. Feel free to reach out if you have any questions/suggestions! Thanks!
@jdamore-linode : I have elaborated on the testing steps, hope it helps! |
packages/manager/src/request.tsx
Outdated
| * Flag to ensure we only send the EUUID to Adobe Analytics once per session. | ||
| * The EUUID doesn't change during a session, so we only need to track it once. | ||
| */ | ||
| let hasTrackedCustomerUuid = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm NOT too sure, but I wanted to point out that this flag looks to be module-scoped, not session-scoped, so it will reset on page reload (i.e. once per JS runtime load). This could potentially lead to duplicate analytics events
The comment mentions "once per session", but it's unclear to me what 'session' means in this context.
Given that we already store the EUUID itself in module-level state (storedCustomerUuid) for later analytics usage, this seems more aligned with an authenticated session rather than a browser session -- but the current implementation doesn't explicitly tie this to auth boundaries
Is "session" here intended to mean:
- an authenticated session (login -> logout / token expiration) OR
- a browser session (tab/window lifetime)?
Depending on the intent we may want to:
- reset this on auth/token changes OR
- persist it via sessionStorage rather than keeping it in memory
Could you clarify the intended semantics here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Based on the feedback I have refactored to a cleaner approach that avoids the module-level flag entirely.
Instead of tracking the EUUID via a module-level flag in the interceptor, I now:
Interceptor (injectEuuidToProfile) - Only injects the _euuidFromHttpHeader into the profile response data
useAdobeAnalytics - Reads the EUUID directly from React Query's profile cache via useProfile
This approach:
- Eliminates module-level mutable state
- Ties EUUID availability to React Query's cache (automatically cleared on logout/login)
- Is more consistent with existing patterns in the codebase
- Makes the session semantics explicit - EUUID is available when profile is loaded, cleared when profile cache is invalidated
2ac8885 to
04cab1b
Compare
04cab1b to
ce9cfa2
Compare
…terceptor level and share it with Adobe analytics through the page view event
jdamore-linode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tanushree-akamai! I believe I was able to verify this locally, but I'll be sure to take a second look in Staging/Prod when the time comes as well just to be sure.
Cloud Manager UI test results🔺 3 failing tests on test run #7 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/images/search-images.spec.ts,cypress/e2e/core/cloudpulse/timerange-verification.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts" |
|||||||||||||||||||||||
Description 📝
Make the EUUID (Enterprise UUID) from the X-Customer-Uuid API response header available to Adobe Analytics via _satellite.track(), including for users with restricted billing access.
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Preview 📷
How to test 🧪
Verification steps
_satellite.setDebug(true)Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅