Skip to content

Commit f5d1c15

Browse files
Update dotcom-rendering/src/components/EnhanceAffiliateLinks.importable.tsx
Co-authored-by: Ravi <[email protected]>
1 parent 0472f79 commit f5d1c15

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dotcom-rendering/src/components/EnhanceAffiliateLinks.importable.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ export const EnhanceAffiliateLinks = () => {
2828
const skimlinksAccountId = getSkimlinksAccountId(link.href);
2929

3030
// Skimlinks treats xcust as one long string, so we use | to separate values
31-
link.href += `&xcust=${encodeURIComponent(
32-
'referrer|' +
33-
referrerDomain +
34-
'|accountId|' +
35-
skimlinksAccountId,
36-
)}`;
31+
const xcustValue = `referrer|${referrerDomain}|accountId|${skimlinksAccountId}`;
32+
33+
link.href = `${link.href}&xcust=${encodeURIComponent(xcustValue)}`;
34+
3735
}
3836
}
3937
});

0 commit comments

Comments
 (0)