/get-utm-source-url.js Secret
Last active
January 2, 2023 20:18
Star
You must be signed in to star a gist
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