(API) Generic Functions

List of all javascript functions


Description: Checks visitor's push notification permissions
Params: N/A
Response: (str) - granted, default or denied


Description: Checks to see if visitor's browser supports push notifications
Params: N/A
Response: (boolean)


Description: Grabs the active visitor's subscriber id. If none exists, one is generated.
Params: N/A
Response: promise, (str) subscriber id

_aimtellGetSubscriberID().then(function(id) { console.log(id) })


Description: Pulls the device push token from the current visitor. This is delivered as a javascript promise.
Params: N/A
Response: promise, (str) device token

_aimtellGetPushToken().then(function(token) { console.log(token) })


Description: Grabs visitors subscriber id based on push token

  • token - required. browser push token

Response: promise, (obj) result, uid

_aimtellGetSubscriberIDFromToken(token).then(function(user){ console.log(user) })
     result: "success", 
     uid: "123sampleuid123"


Grabs current website subscriber's attributes.
Note: As custom attributes may contain which an Aimtell website owner may not want easily viewable, this function by default is locked as a security measure. You must specifically request our team to unlock it for your account



Description: If custom push prompt exists, show it, else load native push prompt
Params: n/a
Response: null


Description: Force shows the custom optin, even if previously denied.
Params: n/a
Response: null