-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
b48468b
commit ee51aeb
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
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); | ||
} | ||
|
||
if (params.gaMeasurementId) { | ||
setCookie('ga_measurement_id', params.gaMeasurementId, 365); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters