FAQ About Web Push Integration and Service Worker

Prev Next

Web Push Integration and Service Worker FAQ explains installation, setup, compatibility, and troubleshooting for Web Push.

Is it possible to add Insider Service Worker to another folder other than the website's root folder?

Yes, the InOne panel allows you to configure a custom path for the Service Worker. The path can be added to another folder as long as the folder is on the website domain and the Service Worker is accessible at www.yourwebsite.com/subfolder/insider-sw-sdk.js.

Can I export Web Push tokens/users/subscribers collected by Insider?

If you use your own GCM/FCM project key and native opt-in or custom opt-in with your domain, we can share a database export of their tokens. However, if you are using our shared GCM/FCM project or a custom opt-in with the useinsider.com domain, we can provide the tokens; however, they may not be usable since they are matched with the Insider GCM/FCM project or domain.
The old tokens will be removed if you want to use your own GCM/FCM project later. Therefore, starting the opt-in screens with your GCM/FCM project during the integration would be a good practice.

We have existing subscribers/tokens from another Web Push provider. Can we use/import them?

If you use native opt-in with another vendor, Insider can automatically generate new tokens for existing subscribers without displaying the opt-in screen when they revisit the website. Old subscribers can be resubscribed within one month or more, depending on the daily traffic. If you use a custom opt-in with another vendor's domain, the auto-subscription will not work, and the users will need to allow the opt-in again. Insider does not perform a manual database import.

Does the Service Worker affect the performance of my website?

A Service Worker is a special JavaScript file that runs a separate thread from the main browser thread and registers against an origin and a path. Once it's registered on the user's browser, it stays there regardless of being online. Once the user visits the website, the browser checks for an update on the Service Worker to ensure the user's version is always up-to-date. It does not harm the website's performance because it is not executed on the website or loaded like other JavaScripts.

Can I host a Service Worker on a CDN?

You cannot host Service Worker on a Content Distribution Network (CDN), it must be on the same domain as the page and accessible directly from www.mywebsite/insider-sw-sdk.js or from a subfolder under the same domain like www.mywebsite.com/insider/insider-sw-sdk.jsThe document registering the Service Worker, the scope of the Service Worker, and the main script of the Service Worker must all be from the exact origin.

Can the Service Worker run on HTTP sites?

No, it cannot. For security reasons, Service Workers run only over HTTPS. Remote origin service workers are not allowed; otherwise, remote origin control would be provided.

Can I use two Web Push providers simultaneously?

If you use native opt-in, then yes, you can. You need to place Insider's Service Worker in a subpath, such as www.mywebsite.com/subpath/insider-sw-sdk.js.

I want to migrate my website to a new domain. Could I transfer the Web Push tokens from my old website to the new one?

If it is a different domain, then it's not possible because tokens are associated with domains.

Do I lose tokens after switching from Custom (HTTP) Opt-in to Native Opt-in?

Since users subscribe to notifications on the "https://mywebsite.api.useinsider.com" domain with Custom Opt-in, these subscriptions are not valid for your domain, such as "https://www.mywebsite.com." However, previously opted-in users receive pushes until their opt-in cookie expires. They need to opt in again later.