Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey rodrigo07,

    You can install a WordPress plugin like Insert Headers and Footers (https://wordpress.org/plugins/insert-headers-and-footers/), visit Settings -> Insert Headers and Footers, and in either box (not both), add:

    var OneSignal = window.OneSignal || [];
    OneSignal.push(function() {
      OneSignal.on('notificationPermissionChange', function(permissionChange) {
        var currentPermission = permissionChange.to;
        console.log('New permission state:', currentPermission);
        /* Output: New permission state: granted */
        /* ADD YOUR GOOGLE ANALYTICS EVENT HERE */
      });
    });

    You’ll need to change the code above of course to actually add your Google Analytics code.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Tag Manager/Analytics’ is closed to new replies.