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
<script type="text/javascript"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for deleting a custom variable. Must be accessed via the Dtr object. | |
* | |
* @param string $key The custom variable to delete. | |
* @return null | |
*/ | |
event.detail.Dtr.deleteCustomVariable('foo'); | |
}); |
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
<script type="text/javascript"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for checking whether there are any custom variables set. | |
* Must be accessed via the Dtr object. | |
* | |
* @return bool True if any custom variable has been registered, false otherwise. | |
*/ | |
event.detail.Dtr.hasCustomVariables(); | |
}); |
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
<script type="text/javascript"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for checking if a custom variable has been registered. | |
* Must be accessed via the Dtr object. | |
* | |
* @param string $key The custom variable key to check. | |
* @return bool True if the custom variable exists, false otherwise. | |
*/ | |
event.detail.Dtr.hasCustomVariable('foo'); |
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
<script type="text/javascript"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for retrieving all custom variables. Must be accessed via the Dtr object. | |
* | |
* @return object A JavaScript object with key/value pairs for custom variables. | |
*/ | |
event.detail.Dtr.getCustomVariables(); | |
}); | |
</script> |
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
<script type="text/javascript"> | |
document.addEventListener('om.Dtr.init', function(event) { | |
/** | |
* API method for retrieving a custom variable. Must be accessed via the app object. | |
* | |
* @param string $key The custom variable key to retrieve. | |
* @return string|bool The value of the custom variable key or false if not found. | |
*/ | |
event.detail.Dtr.getCustomVariable('foo'); | |
}); |
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
<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'); |
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
document.addEventListener('om.Analytics.track', function(event) { | |
if ( 'conversion' === event.detail.Analytics.type ) { | |
dataLayer.push({ | |
'event': 'gaTriggerEvent', | |
'gaEventCategory': 'form', | |
'gaEventAction': 'submit', | |
'gaEventLabel': 'optin-monster' | |
}); | |
} | |
} ); |
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
document.addEventListener('om.Analytics.track', function(event) { | |
// This event is passed the Campaign object | |
console.log(event.detail.Campaign); | |
// This event is passed the Analytics object | |
console.log(event.detail.Analytics); | |
} ); |
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
document.addEventListener('om.Analytics.track', function(event) { | |
if ( 'conversion' === event.detail.Analytics.type ) { | |
console.log(event.detail.Campaign.id + '-' + event.detail.Campaign.type + ' successfully tracked a conversion.'); | |
} else { | |
console.log(event.detail.Campaign.id + '-' + event.detail.Campaign.type + ' successfully tracked an impression.'); | |
} | |
} ); |
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
document.addEventListener('om.Action.window', function(event) { | |
// This event is passed the Campaign object | |
console.log(event.detail.Campaign); | |
// This event is passed the Action object | |
console.log(event.detail.Action); | |
} ); |
NewerOlder