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 One’s 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 One?

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 because they are linked to the Insider One 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 for your GCM/FCM project during integration would be 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 One 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 1 month or longer, depending on 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 One does not perform a manual database import.

Does the Service Worker affect my website's performance?

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 in the user's browser, it stays there, regardless of whether the user is 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 Service Worker's scope, and the Service Worker's main script must all originate from the same 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 One'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.

Which notification shows first if I use two different push providers?

While there are no technical restrictions preventing Insider One’s Service Worker from operating alongside another push provider, this setup is generally not recommended due to potential integration risks and service conflicts.

If you choose to use multiple providers, the delivery order is determined by timing. Whichever provider triggers the push first will reach the user first.