Created
August 8, 2023 11:12
-
-
Save anova/da61834fccc9b0882465aeeb84f8f962 to your computer and use it in GitHub Desktop.
Custom JavaScript Variable for GTM search_term query string
This file contains hidden or 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
// cjs variable name: cjs - search_term (q) | |
function() { | |
var params = new URLSearchParams(window.location.search); | |
return params.get('q'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment