Skip to content

Conversation

@GHaberis
Copy link
Contributor

@GHaberis GHaberis commented Nov 4, 2025

What does this change?

We’d like to be able to append AB test participations to the xcust parameter on Skimlinks URLs. xcust is 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 is xcust=propOneName|propOneValue|propTwoName|propTwoValue etc.

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...

abTestParticipations = {
  serverSideTest: 'control', 
  clientSideTest: 'variant'
};

...gets converted to abTestParticipations|serverSideTest:control,clientSideTest:variant

Note: 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.

@GHaberis GHaberis requested a review from a team as a code owner November 4, 2025 16:48
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@GHaberis GHaberis added the 🥒WiP Work in Progress label Nov 4, 2025
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

@GHaberis GHaberis added run_chromatic Runs chromatic when label is applied and removed 🥒WiP Work in Progress labels Nov 6, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Nov 6, 2025
Copy link
Contributor

@on-ye on-ye left a 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', () => {
Copy link
Contributor

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',
Copy link
Contributor

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', () => {
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants