Push to Subscriber ID

You can assign a unique ID against each subscriber as mentioned in the example. The value here refers to the subscriber ID stored at your end.

Definition

You will have to include the following piece of code after the iZooto has been initialized but before the JS call. Click here for sample code.

window._izq.push(['add_property',{
 name : 'subscriber_id',
 value : '{YOUR_SUBSCRIBER_ID_GOES_HERE}'
}]);

Parameters

NameDescriptionTypeRequired
valueID to be passed against the userStringYes

Sample Code

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

/* Register Subscription Callback - Will only assign a subscriber ID if a 
user subscribers to receive notifications. */

<script>
  window._izq.push(["registerSubscriptionCallback",function(obj){  
    if(obj.statuscode==1) // User Status = Subscribed
    {
    
         // Subscriber ID Code
        window._izq.push(['add_property',{
         name : 'subscriber_id',
         value : '0123abcdef987'
      
      }]);
    }
}]);

</script>

// JS Call
<script src="https://cdn.izooto.com/scripts/83600dbdd34d91e3b153aaf01a445e32dc49e63b.js"></script>

The above code assigns subscriber ID 0123abcdef987 to the subscriber. You can pass subscriber IDs for all the website visitors. However, a fraction of these visitors would actually subscribe to notifications. iZooto stores IDs only for the subscribers, not for all the website visitors. You would obviously need to know which all of these visitors actually subscribed to notifications. You may use the callback function defined below to find out subscribers.

❗️

In order to enable the functionality of assigning Subscriber ID to your visitors, please raise a request to [email protected]

API To Push Notifications

This API can be used to send a notification to an individual subscriber against a subscriber ID.

curl -X POST \
 - H "Authentication-Token: {API_TOKEN}" \
 - H "Content-Type: application/json" \
 -d '{
 "campaign_name" : "{CAMPAIGN_NAME}",
 "title" : "{NOTIFICATION_TITLE}",
 "message" : "{NOTIFICATION_MESSAGE}",
 "icon_url" : "{ICON_URL}",
 "badge_icon_url" : "{BADGE_ICON_URL}",
 "banner_url" : "{BANNER_URL}",
 "landing_url" : "{LANDING_URL}",
 "actions" : [
 {
 "text" : "{BUTTON_1_TEXT}",
 "url" : "{BUTTON_1_URL}",
 "icon" : "{BUTTON_1_ICON}"
 },
 {
 "text" : "{BUTTON_2_TEXT}",
 "url" : "{BUTTON_2_URL}",
 "icon" : "{BUTTON_2_ICON}"
 }],
 "utm_source" : "{UTM_SOURCE}",
 "utm_medium" : "{UTM_MEDIUM}",
 "utm_campaign" : "{UTM_CAMPAIGN}",
 "req_interaction" : {true/false},
 "override_tag" : "{CAMPAIGN_TAG_NAME}",
 "ttl" : {TTL_SECONDS},
 "target" : {
 "type" : "subscriber_id",
 "value" : "{SUBSCRIBER_ID_OF_THE_SUBSCRIBER}"
 }
 }' "https://apis.izooto.com/v1/notifications"

Parameters

NameDescriptionTypeRequiredSupported On
Authentication-tokenAPI token for your siteStringYes-
Campaign NameCampaign TitleStringYesWeb Push:
Chrome, Firefox, Safari, Opera and Edge

App Push:
Android
TitleNotification TitleStringYesChrome,
Firefox,
Safari
MessageMessage on NotificationStringYesChrome,
Firefox,
Safari
icon_urlNotification icon URL
(HTTPS URL Only)
(Size: 200 X 200)
StringYesChrome,
Firefox,
badge_icon_urlBadge icon URL
File Size <= 20kb
(HTTPS URL Only)
(Dimensions: 72 X 72)
String
PNG formats only
NoWeb Push:
Chrome 50+,
Firefox 44+,
Opera 42+,
Edge 17+

App Push:
Android
banner_urlURL of banner image
(HTTPS)
(Size: 360 X 240 for Desktop and 360 X 200 for Mobile)
StringNoOnly Chrome 56+
landing_urlLanding Page URLStringYesChrome,
Firefox,
Safari
actions > textButton TextStringNoOnly Chrome 48+
actions > urlButton Landing URLStringNoOnly Chrome 48+
actions > iconButton Icon URL
File Size <= 20kb
(HTTPS URL Only)
(Dimensions: 24 X 24)
String
Jpg, Jpeg, Png formats only
NoWeb Push:
Chrome 56+,
Opera 57+,
Edge 17+

App Push:
Android
utm_sourceUTM SourceStringNoChrome,
Firefox,
Safari
utm_mediumUTM MediumStringNoChrome,
Firefox,
Safari
utm_campaignUTM CampaignStringNoChrome,
Firefox,
Safari
req_interactionMake Notifications StickyBooleanNoWeb Push:
Chrome
override_tagShow Latest Campaign TagStringNoWeb Push:
Chrome
ttl (time-to-live)Notification expiry timeNumeric (seconds)NoChrome,
Firefox
subscriber_idID of subscriberStringYes-

Sample API Code

curl -X POST \ 
 - H "Authentication-Token: abc123efgh456ijklmn9786" \
 - H "Content-Type: application/json" \
 -d '{
 "campaign_name" : "Test Campaign"
 "title" : "Limited Period Offer",
 "message" : "Go Shopping, Save Big",
 "icon_url" : "https://yourdomain.com/icon.png",
 "badge_icon_url" : "https://yourdomain.com/badge_icon.png",
 "banner_url" : "https://yourdomain.com/large-image.png",
 "landing_url" : "https://yourdomain.com/offers",
 "actions" : [
 {
 "text" : "Buy Now",
 "url" : "https://yourdomain.com/buy-now",
 "icon" : "https://yourdomain.com/button_1_icon.png"
 },
 {
 "text" : "Compare",
 "url" : "https://yourdomain.com/compare",
 "icon" : "https://yourdomain.com/button_2_icon.png"
 }],
 "utm_source" : "izooto",
 "utm_medium" : "push_notification",
 "utm_campaign" : "promotion",
 "req_interaction" : true,
 "override_tag" : "My Tag",
 "ttl" : 86400,
 "target" : {
 "type" : "subscriber_id",
 "value" : 8567891900
 }
 }' "https://apis.izooto.com/v1/notifications"

What’s Next