ActionPop Javascript API
Initialize OnVoard object
Specify the following snippet once before you add any javascript API code so that OnVoard object is initialized.
<script>
(function() {
window.OnVoard = window.OnVoard || function() {
(window.OnVoard.q = window.OnVoard.q || []).push(arguments);
};
})();
</script>
Below are available methods for ActionPop's Javascript API.
Set Custom Properties
Set custom properties. When setting up prompts, you can specify display conditions to filter by custom properties.
OnVoard('prompt', 'setCustomProperties', {
'logged_in': false,
'source': 'google',
});
On Ready Event
Execute a callback function when ActionPop scripts are loaded and ready.
const promptReadyCallback = () => {
console.log("ActionPop is ready");
};
OnVoard('prompt', 'onReady', promptReadyCallback);
ActionPop Display Event
Execute a callback function when ActionPop is display. This will be executed everytime a ActionPop is display.
const promptDisplayCallback = (promptId) => {
console.log(`ActionPop display: ${promptId}`);
};
OnVoard('prompt', 'onPromptDisplay', promptDisplayCallback);
ActionPop Close Event
Execute a callback function when ActionPop is close. This will be executed everytime a ActionPop is close.
const promptCloseCallback = (promptId) => {
console.log(`ActionPop close: ${promptId}`);
};
OnVoard('prompt', 'onPromptClose', promptCloseCallback);
Track ActionPop Impression Event
Execute a callback function to track ActionPop impression metric. You can use this to trigger pixels for analytics platforms like Google Analytics. The difference between this callback and onPromptDisplay is that this callback will automatically excludes duplicate impressions.
const trackPromptImpressionCallback = (promptId) => {
yourTrackingScript(promptId);
};
OnVoard('prompt', 'onTrackPromptImpression', trackPromptImpressionCallback);
Track ActionPop Engagement Event
Execute a callback function to track ActionPop engagement metric. You can use this to trigger pixels for analytics platforms like Google Analytics.
const trackPromptEngagementCallback = (promptId) => {
yourTrackingScript(promptId);
};
OnVoard('prompt', 'onTrackPromptEngagement', trackPromptEngagementCallback);
Track ActionPop Close Event
Execute a callback function to track ActionPop close metric. You can use this to trigger pixels for analytics platforms like Google Analytics. The difference between this callback and onPromptClose is that this callback will automatically excludes duplicate closes.
const trackPromptCloseCallback = (promptId) => {
yourTrackingScript(promptId);
};
OnVoard('prompt', 'onTrackPromptClose', trackPromptCloseCallback);

