Skip to content

Instantly share code, notes, and snippets.

@padicode
Last active December 14, 2015 09:38
Show Gist options
  • Save padicode/5066547 to your computer and use it in GitHub Desktop.
Save padicode/5066547 to your computer and use it in GitHub Desktop.
JavaScript hooks for PadiAct actions
<script type="text/javascript">
window.nrlskOnEvent = function(padiact)
{
if (padiact.type=='open')
{
// the code that needs to run when the PadiAct pop-up is displayed goes here
// example:
console.log ('PadiAct Showed Up');
// available vars:
// padiact.id (padiact campaign ID)
// padiact.name (padiact campaign name)
}
if (padiact.type=='subscribe')
{
// here should go the code that needs to run when the PadiAct pop-up is displayed
// the email address of the subscriber is available and url encoded: e.g. user%40gmail.com
// example:
console.log (padiact.email+' subscribed through PadiAct');
// available vars:
// padiact.email (url encoded email of person that subscribed)
// padiact.id (padiact campaign ID)
// padiact.name (padiact campaign name)
}
if (padiact.type=='close')
{
// here should go the code that needs to run when the PadiAct pop-up is closed (without subscribing)
// example:
console.log ('PadiAct Window Closed');
// available vars:
// padiact.id (padiact campaign ID)
// padiact.name (padiact campaign name)
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment