-
Notifications
You must be signed in to change notification settings - Fork 30
Append abTestParticipations to the xcust query string param for Skimlinks #14792
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: main
Are you sure you want to change the base?
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
dotcom-rendering/src/components/EnhanceAffiliateLinks.importable.tsx
Outdated
Show resolved
Hide resolved
on-ye
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.
Minus the minor questions, LGTM
| expect(link?.href).toBe('https://example.com/'); | ||
| }); | ||
|
|
||
| it('should append xcust parameter to Skimlinks with refferer set to none if unavailable', () => { |
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.
minor: referrer rather than refferer
|
|
||
| const link = document.querySelector('a'); | ||
| expect(link?.href).toContain( | ||
| 'xcust=referrer%7Cfoo.com%7CaccountId%7C12345%7CabTestParticipations%7Ctest1%3AvariantA%2Ctest2%3AvariantB', |
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.
just curious, is the test naming case sensitive?
just incase we inadvertantly change the name from variantA to varianta ... will it have any ramifications on data? If so, it maybe best to lowercase the entire querystring, i.e. accountid, abtestparticipations, varianta, variantb
| ); | ||
| }); | ||
|
|
||
| it('should append xcust parameter to Skimlinks with refferer set if available', () => { |
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.
also minor spelling mistake on referrer
What does this change?
We’d like to be able to append AB test participations to the
xcustparameter on Skimlinks URLs.xcustis the mechanism for passing custom properties to Skimlinks, it's a single query string parameter with a string value that can be used to encode multiple data properties. The pattern for passing multiple props isxcust=propOneName|propOneValue|propTwoName|propTwoValueetc.Here’s an existing skimlinks URL with the xcust param:
https://go.skimresources.com/?id=114047X1572903&xs=1&url=https://www.datapowertools.co.uk/Products/Landscaping_Garden_Tools/MIL4933499234&sref=https://www.theguardian.com/thefilter/2025/oct/24/garden-gadget-made-tidying-fun&xcust=referrer|www.theguardian.com|accountId|114047X1572903.Because xcust doesn’t support nested delimiters or structured encoding, the safest and most robust approach to encode multiple A/B test participations into a single string is to join them by a secondary delimiter that won’t conflict with the
|delimiter. We have therefore agreed with Data Tech to use a comma to separate multiple tests.For example, this...
...gets converted to
abTestParticipations|serverSideTest:control,clientSideTest:variantNote: We're not filtering ab test participations to only add “filter” related AB test participations, we're passing all participations. To filter the tests we'd have to be able to to differentiate tests we care about, eg. we could check on a team name prefix on the test name, however we'd then be relying on team name being specified and matching whatever condition we write in code - it could lead to us not passing test participations if these conditions aren’t met in exactly the way we write in code, it feels prone to error.
Why?
The click/conversion data we export from Skimlinks can be analysed and filtered on AB test participations.