Home / Admin / setcustomvariable.js
Duplicate Snippet

Embed Snippet on Your Site

setcustomvariable.js

Code Preview
html
<script type="text/javascript">
	document.addEventListener('om.Dtr.init', function(event) {
		/**
		 * API method for setting a custom variable. Must be accessed via the Dtr object.
		 *
		 * @param string $key   The custom variable key to set.
		 * @param string $value The custom variable value to set for the key.
		 * @return null
		 */
		event.detail.Dtr.setCustomVariable('foo', 'bar');
	});
</script>

Comments

Add a Comment