Gather utm params and add to outbound product links (#1336)

* gather utm params and add to outbound product links

* segment needs testing across all environments, not just in production

* campaign => content

* adding two more ids

* sessionStorage for gtm params and cleanup

* move newParams conditional

* move addUTMToLinks() to helpers file
This commit is contained in:
jasonbryant84
2024-12-09 07:59:58 +00:00
committed by GitHub
parent b48468b67b
commit ee51aeb4f4
3 changed files with 52 additions and 2 deletions
@@ -1,6 +1,11 @@
import * as params from '@params';
import { setCookie } from './helpers';
import { setSegmentWriteKey } from './segment-helpers';
import { addUTMToLinks } from './helpers';
document.addEventListener('DOMContentLoaded', () => {
addUTMToLinks();
});
if (params.segmentWriteKey) {
setSegmentWriteKey(params.segmentWriteKey);
@@ -8,4 +13,4 @@ if (params.segmentWriteKey) {
if (params.gaMeasurementId) {
setCookie('ga_measurement_id', params.gaMeasurementId, 365);
}
}