-
-
Save nocodesupplyco/cd032a57b608a615656bce8b5b24f5ca to your computer and use it in GitHub Desktop.
Get UTM Parameter Source From URL
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
// search the URL as a string | |
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
// do something if the URL has a specific parameter and it has a value | |
if (urlParams.has('utm_source') && urlParams.get('utm_source') > "") { | |
//...do something | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment