All Collections
Getting Started
Testing the Integration
How can I test my web push integration?
How can I test my web push integration?

Follow this guide to make sure Batch is integrated correctly into your website before going live.

Lucie avatar
Written by Lucie
Updated over a week ago

Once you have completed the steps described in the web push integration guide, there are several elements that you should check to make sure you will be able to use Batch at its full potential.

There are two scenarios if you integrate web push:

Case A: The notification prompt is triggered correctly

In this case, follow these steps:

1. Send a test push to your browser

Allow push notifications and try sending a test notification to your browser (Repeat the same step on Chrome, Firefox and Safari).

2. Review your website icons

Ensure icons match the required size and format (see documentation).

In particular, make sure that the small icon has a transparent background and is properly displayed (i.e. not a grey circle) on Android.

3. Firefox and Safari custom alert (optional)

If you choose to use Batch pre-permission prompts to set a custom alert on Firefox and Safari, ensure it is displayed when you arrive on the website and fits the custom UI that you want to display.

4. Custom User ID (optional)

If you choose to set up a Custom User ID, make sure it is sent to Batch when you log in on the website using the Debug tool on the dashboard (Settings > Debug) and your Installation ID.

You can use the refresh button to see the latest data.


Note: The Custom User ID must be reset when the user logs out of the website. (i.e. the field must be empty)

5. Language & Region (optional)

If you choose to overwrite the default values detected by the SDK with the user's selection in the website, you can check that it is updated correctly using the Debug tool on the dashboard (Settings > Debug) and your Installation ID.

You can use the refresh button to see the latest data.

Case B: The permission prompt is not triggered on your website

In this case, check the following:

1. Clear the data stored for your website

Make sure you reset your browser preferences between each test: see how to do it here.

2. Staging domain name

If you deployed Batch on a staging version of your website, make sure your JavaScript tag contains the "dev: true" parameter and you added your staging domain name to the list of "Allowed dev origins", from the dashboard Settings > Push settings. If you are testing on Safari, make sure you have added your testing domain as a newly allowed domain. (see How to test web push on development environment?)

3. Dev mode

If you deployed Batch in production, make sure you removed the "dev: true" parameter from the Javascript tag.

4. Service worker

Make sure that the Service Worker is well integrated at the root of your website: type the name of the service worker after the domain name (e.g. mywebsite.com/batchsdk-worker-loader.js).
You may have chosen to add the service worker in a subfolder, in which case the path must be indicated in the JavaScript tag (see documentation).
In case you integrated it with an existing service worker, ensure you followed all steps of this documentation.

5. Unsecure environment

Ensure that your test website is secure. For any service worker to work, it is essential to use HTTPS and to have an accepted/valid certificate (read more here).

Need more help?

If you have any questions, don't hesitate to ping us at support@batch.com, or directly on the Live chat!


This article belongs to Batch's FAQ. Need more help? Find insightful articles, documentation, case & market studies, guides, and even more in our website's Resources section on batch.com and our blog.

Did this answer your question?