- Joined
- May 7, 2018
- Messages
- 3,917
Is anyone using OneSignal that could tell me how to accurately track when someone allows push notifications on a landing page?
Currently, I'm using the following Javascript, and it's tracking most of the subscriptions, but for some reason, it's not tracking all of them:
Is there a better way (i.e. different method) to track this?
Edit: btw, here are the docs
Currently, I'm using the following Javascript, and it's tracking most of the subscriptions, but for some reason, it's not tracking all of them:
JavaScript:
OneSignal.on('notificationPermissionChange', function (permissionChange) {
var currentPermission = permissionChange.to;
switch (currentPermission) {
case 'granted':
console.log('✅ Permission - ALLOWED');
break;
case 'denied':
console.log('❌ Permission - DENIED');
break;
case 'default':
console.log('😭 Permission - CLOSED');
break;
}
});
Is there a better way (i.e. different method) to track this?
Edit: btw, here are the docs