Integrate with Google Analytics

With iZooto's Google Analytics integration, you can start tracking your subscriptions and unsubscription data on Google Analytics (GA) directly. This allows you to directly track your subscriber count, their performance ( wrt notifications ), subscriber churn in one single dashboard. 

 

Integration

The integration is fairly straightforwad. You can enable this by tweaking the main iZooto JS code snipping. It essentially uses the request callback function, to pass the subscription status to your GA.

1. Paste the below snippet of code between the first 2 lines of the pixel and save the file

<script>
window._izq.push(["registerSubscriptionCallback",function(obj){
console.log(obj);
if(obj.statuscode==1)
{
 ga('create', 'UA-XXXXX-Y', 'auto');
 ga('send','event','izooto', obj.response);

}
}]);

</script>

2. Here is how the final piece of code should look like

<html>
<head>
<script> window._izq = window._izq || []; window._izq.push(["init"]);</script>

<script>
window._izq.push(["registerSubscriptionCallback",function(obj){
console.log(obj);
if(obj.statuscode==1)
{
 ga('create', 'UA-123ABC-Y', 'auto');
 ga('send','event','izooto', obj.response);
}
}]);

</script>

<script src="https://cdnpixel.izooto.com/scripts/12345abcdef678.js"></script> <!--this is a sample pixel-->

</head>
</html>

This will ensure that whenever someone clicks on the 'allow' button on the subscription opt-in, his/her subscription gets passed to GA too.

In case you wish to capture more responses in GA and not just the subscriptions, you can add/edit the status code. Here is the list of the codes

 

Verification in the Browser Console

1. The subscription opt-in appears on your website

2. A user clicks on the 'allow' button and becomes a subscriber

3. The GA script gets triggered

 

Verification on Google Analytics

  

1. Navigate to 'Events' under 'Behavior' on the left-hand menu

2. Click on 'Add Segment' and click on 'Conditions'

3. Choose the parameter as 'Event Category', operational filter as 'exactly matches' and type the value as 'izooto'

4. Click on the And operation, choose the next parameter as 'Event Action', operational filter once again as 'exactly matches' and type the value as 'subscribed'

5. Save the segment as iZooto Subscribers or something similar. You can click on Preview too to verify if the segment is working correctly

Now you can use this segment and compare against the rest of your users and segments to see how iZooto's subscribers are performing.

 


Did this help answer your question?

thumbs up
thumbs down

Thanks for the feedback! 🙏🏽