Widget Callback
Business and Premium users can set up widget callback for the Gleam widget to send events which you can listen for on your website.
Callbacks can be turned on via the widget "Install Options" tab.
This is useful for:
- Firing tracking or conversion scripts on your page
- Adding a Coupon to the users cart
- Updating content on the page
- Unlocking something on the page based on which Action the user completes
Each entered
event includes a unique ID for the action that has been completed:
<script>
window.onGleamEvent = function(event) {
console.log(event);
/*
Logs an object like this:
{
type: "entered",
campaign: { key: "MqJxR", name: "My Newsletter Competition" },
action: { id: 4242, title: "Sign up for our newsletter" }
}
OR
{
type: "loaded",
campaign: { key: "MqJxR", name: "My Newsletter Competition" }
}
*/
};
</script>