Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Forked from thomasgriffin/getcustomvariable.js
Last active May 7, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/acf4e0d93bab578cb4966cafb827c676 to your computer and use it in GitHub Desktop.
Save jtsternberg/acf4e0d93bab578cb4966cafb827c676 to your computer and use it in GitHub Desktop.
OptinMonster Dynamic Text Replacement API - getCustomVariable
<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');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment