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

Name

Description

Type

Required

value

ID to be passed against the user

String

Yes

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

Name

Description

Type

Required

Supported On

Authentication-token

API token for your site

String

Yes

Campaign Name

Campaign Title

String

Yes

Web Push:
Chrome, Firefox, Safari, Opera and Edge

App Push:
Android

Title

Notification Title

String

Yes

Chrome,
Firefox,
Safari

Message

Message on Notification

String

Yes

Chrome,
Firefox,
Safari

icon_url

Notification icon URL
(HTTPS URL Only)
(Size: 200 X 200)

String

Yes

Chrome,
Firefox,

badge_icon_url

Badge icon URL
File Size <= 20kb
(HTTPS URL Only)
(Dimensions: 72 X 72)

String
PNG formats only

No

Web Push:
Chrome 50+,
Firefox 44+,
Opera 42+,
Edge 17+

App Push:
Android

banner_url

URL of banner image
(HTTPS)
(Size: 360 X 240 for Desktop and 360 X 200 for Mobile)

String

No

Only Chrome 56+

landing_url

Landing Page URL

String

Yes

Chrome,
Firefox,
Safari

actions > text

Button Text

String

No

Only Chrome 48+

actions > url

Button Landing URL

String

No

Only Chrome 48+

actions > icon

Button Icon URL
File Size <= 20kb
(HTTPS URL Only)
(Dimensions: 24 X 24)

String
Jpg, Jpeg, Png formats only

No

Web Push:
Chrome 56+,
Opera 57+,
Edge 17+

App Push:
Android

utm_source

UTM Source

String

No

Chrome,
Firefox,
Safari

utm_medium

UTM Medium

String

No

Chrome,
Firefox,
Safari

utm_campaign

UTM Campaign

String

No

Chrome,
Firefox,
Safari

req_interaction

Make Notifications Sticky

Boolean

No

Web Push:
Chrome

override_tag

Show Latest Campaign Tag

String

No

Web Push:
Chrome

ttl (time-to-live)

Notification expiry time

Numeric (seconds)

No

Chrome,
Firefox

subscriber_id

ID of subscriber

String

Yes

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"

Did this page help you?