Skip to main content
Callback functions work in the opposite direction to the rest of the Javascript API: instead of you calling Aimtell, Aimtell calls you. You define these functions on your page, and the Aimtell script runs them when the matching event happens: the script finishing loading, or a visitor granting, ignoring or denying push permission. Each one is optional. If you haven’t defined it, nothing happens. Define them as regular global functions using the exact names below, and make sure they exist before the Aimtell script loads.

Aimtell Ready

Description: Called when aimtell script has finished loading.

Example


Permission Granted

Description: Called after website visitor has granted push notification permissions.

Example


Permission Ignored

Description: Called after website visitor has ignored push notification permissions. (clicking “x” on the request dialog)

Example


Permission Denied

Description: Called after website visitor has denied push notification permissions.

Example