Push notifications

Push notifications on iOS

Apple does not support web push notifications on iOS at this time.

Push notifications allows you to send targetted notifications from your e-shop, and thanks to that they can receive them even when they are not directly on your website. When the customers first reaches your e-shop, they will see something like this:

After clicking on “Allow” the user can now be targetted with those notifications. You can create them in the “Push notifications” section on the left panel in Samba. They can look like this:

Setting up the Push notifications:

  1. Go to Settings > Extensions and download the script, which is neccessary for the Push notifications to work properly. Put it into the root directory of your e-shop in the original form (the same content, the same name). If you have multiple domains under one root folder included in your filehosting service, follow this guide. 
  2. After implementing the script, please contact our support at  support@samba.ai or through the In-app chat – we need to perform an activation for your e-shop on our side, too.
  3. After activating the script from our side, you can use the panel on the left side to work with Push notifications.
  4. Click on “New Push notification” and create a notification based on the required fields. That’s it!
Encoding special characters

Currently only officially supported characters accoring to specification RFC 3986 can be inserted in the URL link. If you need to use any other special characters, they have to be encoded (i.e., replaced by another characters), e.g., using this encoding table.
For example in order to replace square brackets use the following:

  • [ –> %5B
  • ] –> %5D

Thus the link https://www.example.com?param=value[1] will be changed to https://www.example.com?param=value%5B1%5D.

(Optional) Custom Opt-in Popup

In addition to the regular Push notification popup, you can also create your own, personalized popup to help growing your database. You can edit any text in the custom popup – not only the main text, but also buttons (such as Allow/Deny), which will bring more customers to your database.

You can find the Custom Opt-in Popup in the Account settings > Extensions (in your Samba account):

To edit the popup, simply click “Edit Popup”. You will be greeted with a window, where you can edit every part of the contents of the popup.

You can enable/disable the Custom Opt-in Popup using the switch on the left side:

After enabling it, the Custom Opt-in Popup window will be shown, when customer reaches your eshop. It needs to be noted, that if customer agrees to the Push notifications through the custom window, a default browser Push notification window will pop-up. This is a normal behavior and there is currently no way to bypass this.

(Optional) More domains with single root folder

If you have multiple domains under one root folder included in your filehosting service (e.g. CZ and SK domains), you can use only one samba-sw.js script. In this case you’ll need to edit the contents of the script to the following:

switch (self.location.hostname) {
case "domain1.com":
importScripts("https://yottlyscript.com/push/service-worker.js?tp=*TRACKPOINT FOR DOMAIN1*");
break;
case "domain2.com":
importScripts("https://yottlyscript.com/push/service-worker.js?tp=*TRACKPOINT FOR DOMAIN2*");
break;
.
.
.
}

The “Trackpoint” value can be found in your Samba account’s URL (pay attention to the “bold” part of the text):

https://enterprise.samba.ai/shop/123456789/dashboard

Pay attention to the domain you use in the script – www.domain.com is not the same as domain.com. Therefore, we recommend using the console to verify what is returned as the value of self.location.hostname and set this in the script condition.

This post is also available in: Čeština (Czech)

Updated on September 24, 2021

Was this article helpful?

Related Articles