Last active
June 27, 2023 20:06
-
-
Save ericakfranz/d9d450e9807b1ca6ff2390426c04334a to your computer and use it in GitHub Desktop.
OptinMonster Custom Smart Tag to capture all query args.
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
const queryString = window.location.search; // capture all query args | |
document.addEventListener('om.Dtr.init', function(event) { | |
// use this event instead if added directly through the OM campaign builder | |
// document.addEventListener('om.Campaign.load', function(event) { | |
// Registers {{query_args}} smart tag that outputs all query args from the current page. | |
event.detail.Dtr.setCustomVariable('query_args', queryString); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment