Skip to content

Commit fece7df

Browse files
Adding in code comment to explain the utmParamsString logic
1 parent 70ba87f commit fece7df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export const EnhanceAffiliateLinks = () => {
6868

6969
const utmParamsFromReferrer = getUtmString(referrerURLParams, utmKeys);
7070

71+
/* Selects UTM parameters from the article URL if present;
72+
otherwise it falls back to UTM parameters from the referrer URL if those exist.
73+
If neither are present it returns an empty string.*/
7174
const utmParamsString =
7275
utmParamsFromArticleURL && utmParamsFromArticleURL.trim() !== ''
7376
? utmParamsFromArticleURL

0 commit comments

Comments
 (0)