Aimtell

Aimtell Documentation

Welcome to the Aimtell documentation hub. You'll find comprehensive guides and documentation to help you start working with Aimtell as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Triggering Javascript After Prompt Approval/Denial

With Aimtell's Javascript API it's easy to trigger some custom javascript after your website visitor either approves or denies your request for push notifications.

Scenario 1 - Visitor approves the subscription prompt.

If a visitor approves the push notification prompt, the function _aimtellPermissionGranted() is called. So, in order to execute some javascript after the visitor grants permissions, set up something like this on your website:

<script>
function _aimtellPermissionGranted(){
	console.log("Wohoo, visitor subscribed to push!");
}
</script>

Scenario 2 - Visitor denies the subscription prompt.

If a visitor denies the push notification prompt, the function _aimtellPermissionDenied() is called. So, in order to execute some javascript after the visitor denies permissions, set up something like this on your website:

<script>
function _aimtellPermissionDenied(){
	console.log("Darn, visitor didn't subscribe to our push");
}
</script>

Triggering Javascript After Prompt Approval/Denial