File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { useBetaAB } from '../lib/useAB';
2323 * (No visual story exists as this does not render anything)
2424 */
2525
26+ // Helper to extract UTM parameters from URLSearchParams
2627function getUtmString ( params : URLSearchParams , keys : string [ ] ) : string {
2728 return keys
2829 . map ( ( key ) => {
@@ -72,8 +73,11 @@ export const EnhanceAffiliateLinks = () => {
7273 console . log ( 'utmFromReferrer:' , utmParamsFromReferrer ) ;
7374
7475 const utmParamsString =
75- utmParamsFromArticleURL ?? utmParamsFromReferrer ?? '' ;
76- console . log ( 'final utmParamsString:' , utmParamsString ) ;
76+ utmParamsFromArticleURL && utmParamsFromArticleURL . trim ( ) !== ''
77+ ? utmParamsFromArticleURL
78+ : utmParamsFromReferrer && utmParamsFromReferrer . trim ( ) !== ''
79+ ? utmParamsFromReferrer
80+ : '' ;
7781
7882 for ( const link of allLinksOnPage ) {
7983 if ( isSkimlink ( link . href ) ) {
You can’t perform that action at this time.
0 commit comments