Google Analytics Integration

You can track following Webpushr events in Google Analytics using webpushrPermissionAction function. You can add this code to any page where you want to track events. Through this integration, you can start to correlate Webpushr events to your site analytics. For example, you can determine which content pieces or sections of your site are driving relatively higher Webpushr subscription rate vs. lower.

Notification Permission Accepted

This event is triggered whenever a user subscribes to receive push notifications. Keep in mind that this only records acceptance action performed on the native browser prompt. It does NOT record approval actions performed on the custom prompt types.

Please use webpushrPermissionAction function as shown below:

<script>
  function webpushrPermissionAction( permission_action ){
    if( permission_action == 'granted'){
      ga('send', {
        hitType: 'event',
        eventCategory: 'Webpushr',
        eventAction: 'Permission Accepted',
      });
    }
  }
</script>

Notification Permission Denied

This event is triggered whenever a user denies to receive push notifications. Keep in mind that this only records denial action performed on the native browser prompt. It does NOT record denial/dismiss actions performed on the custom prompt types.

Please use webpushrPermissionAction function as shown below:

<script>
   function webpushrPermissionAction( permission_action ){
      if( permission_action == 'denied'){
         ga('send', {
            hitType: 'event',
            eventCategory: 'Webpushr',
            eventAction: 'Permission Denied',
         });
      }
   }
</script>