Home / Admin / om-custom-smart-tag-all-query-args.js
Duplicate Snippet

Embed Snippet on Your Site

om-custom-smart-tag-all-query-args.js

Code Preview
js
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);
});

Comments

Add a Comment