-
Notifications
You must be signed in to change notification settings - Fork 391
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
Merged
tanushree-akamai
merged 7 commits into
linode:develop
from
tanushree-akamai:feature/UIE-9805-euuid-for-adobe-analytics
Jan 6, 2026
+166
β3
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f6a73aa
feat: [UIE-9805] - Extract EUUID from /profile header and send to Adoβ¦
tanushree-akamai ce9cfa2
Added mock data for validating EUUID extraction in local.
tanushree-akamai 1f715e9
Added changeset: Extract EUUID from authenticated API calls at the inβ¦
tanushree-akamai 4524e2a
Address review comments
tanushree-akamai 8f9a6fa
Address review comments by Alban.
tanushree-akamai 2d7d93e
Use Extended Profile type for euuid alongwith a custom hook for type β¦
tanushree-akamai fad5040
Merge branch 'develop' into feature/UIE-9805-euuid-for-adobe-analytics
tanushree-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Added | ||
| --- | ||
|
|
||
| Extract EUUID from authenticated API calls at the interceptor level and share it with Adobe analytics through the page view event ([#13229](https://github.com/linode/manager/pull/13229)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { renderHook, waitFor } from '@testing-library/react'; | ||
|
|
||
| import { http, HttpResponse, server } from 'src/mocks/testServer'; | ||
| import { wrapWithTheme } from 'src/utilities/testHelpers'; | ||
|
|
||
| import { useEuuidFromHttpHeader } from './useEuuidFromHttpHeader'; | ||
|
|
||
| describe('useEuuidFromHttpHeader', () => { | ||
| it('returns EUUID when the header is included', async () => { | ||
| const mockEuuid = 'test-euuid-12345'; | ||
|
|
||
| server.use( | ||
| http.get('*/profile', () => { | ||
| return new HttpResponse(null, { | ||
| headers: { 'X-Customer-Uuid': mockEuuid }, | ||
| }); | ||
| }) | ||
| ); | ||
|
|
||
| const { result } = renderHook(() => useEuuidFromHttpHeader(), { | ||
| wrapper: (ui) => wrapWithTheme(ui), | ||
| }); | ||
|
|
||
| await waitFor(() => { | ||
| expect(result.current.euuid).toBe(mockEuuid); | ||
| }); | ||
| }); | ||
|
|
||
| it('returns undefined when the header is not included', async () => { | ||
| server.use( | ||
| http.get('*/profile', () => { | ||
| return new HttpResponse(null, { | ||
| headers: {}, | ||
| }); | ||
| }) | ||
| ); | ||
|
|
||
| const { result } = renderHook(() => useEuuidFromHttpHeader(), { | ||
| wrapper: (ui) => wrapWithTheme(ui), | ||
| }); | ||
|
|
||
| await waitFor(() => { | ||
| expect(result.current.euuid).toBeUndefined(); | ||
| }); | ||
| }); | ||
|
|
||
| it('returns undefined when profile is loading', () => { | ||
| const { result } = renderHook(() => useEuuidFromHttpHeader(), { | ||
| wrapper: (ui) => wrapWithTheme(ui), | ||
| }); | ||
|
|
||
| // Before the profile loads, euuid should be undefined | ||
| expect(result.current.euuid).toBeUndefined(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { useProfile } from '@linode/queries'; | ||
|
|
||
| import type { UseQueryResult } from '@tanstack/react-query'; | ||
| import type { ProfileWithEuuid } from 'src/request'; | ||
|
|
||
| /** | ||
| * Hook to get the customer EUUID (Enterprise UUID) from the profile data. | ||
| * The EUUID is injected by the injectEuuidToProfile interceptor from the | ||
| * X-Customer-Uuid header. | ||
| * | ||
| * NOTE: this won't work locally (only staging and prod return this header) | ||
| */ | ||
| export const useEuuidFromHttpHeader = () => ({ | ||
| euuid: (useProfile() as UseQueryResult<ProfileWithEuuid>).data | ||
| ?._euuidFromHttpHeader, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ type DTMSatellite = { | |
| }; | ||
|
|
||
| interface PageViewPayload { | ||
| euuid?: string; | ||
| url: string; | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.