# How to test my Web Push integration?

Once you have completed the steps described in the [web push integration guide](/getting-started/other/implementation-guides/integration-steps-web.md), several elements should be checked to make sure you will be able to use Batch to its full potential.

There are two scenarios if you integrate web push:

## Case A: The notification prompt is triggered correctly <a href="#h_769e01e179" id="h_769e01e179"></a>

<figure><img src="/files/UqptW2mk2MkTQTc705QG" alt="Google Chrome native prompt" width="563"><figcaption></figcaption></figure>

In this case, follow these steps:

{% stepper %}
{% step %}

### Send a test push to your browser <a href="#h_ec915abfce" id="h_ec915abfce"></a>

<figure><img src="/files/vcG9wgVCdopKCwpX3TDz" alt=""><figcaption></figcaption></figure>

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

Here is how to do it: [How to send a test push notification to your web browser?](https://doc.batch.com/guides-and-best-practices/message/push-notifications/how-to-send-a-test-push-notification-to-your-web-browser)
{% endstep %}

{% step %}

### Review your website icons <a href="#h_1ec843dfe1" id="h_1ec843dfe1"></a>

Ensure icons match the required size and format ([see documentation](https://doc.batch.com/web/getting-started/prerequisites#icons-management)).

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

Here is [how to send a test notification to a web browser on Android](https://doc.batch.com/developer/technical-guides/how-to-guides/mobile/android-specific/how-to-send-a-test-notification-to-my-web-browser-on-android).
{% endstep %}

{% step %}

### Firefox and Safari custom alert (optional) <a href="#h_b68b2e33be" id="h_b68b2e33be"></a>

<figure><img src="/files/fihiQ6m0y4DNEIOSrikP" alt="Safari pre-prompt notification authorization"><figcaption></figcaption></figure>

If you choose to use Batch pre-permission prompts to [set a custom alert on Firefox and Safari](/developer/technical-guides/how-to-guides/web/how-to-trigger-the-native-notification-permission-prompt-on-firefox-and-safari.md), ensure it is displayed when you land on the website and fits the custom UI that you want to display.
{% endstep %}

{% step %}

### Custom User ID (optional) <a href="#h_e73eda896d" id="h_e73eda896d"></a>

<figure><img src="/files/tlVuLQASG9Vc97DMljcc" alt="User profile view highlighting Custom User ID value"><figcaption></figcaption></figure>

If you choose to[ set up a Custom User ID](https://doc.batch.com/developer/sdk/web/profile-data/custom-user-id), make sure it is sent to Batch when you log in to the website using the Profile view on the dashboard (Profiles > Search Profiles) and your [Installation ID](https://doc.batch.com/guides-and-best-practices/message/push-notifications/how-to-send-a-test-push-notification-to-your-web-browser#h_17fa92f09d).

{% hint style="danger" %}
The Custom User ID must be reset when the user logs out of the website. (i.e., the field must be empty)
{% endhint %}
{% endstep %}

{% step %}

### Language & Region (optional) <a href="#h_bc7ef32ebe" id="h_bc7ef32ebe"></a>

<figure><img src="/files/72wEFk95lNzM2J8qJq5E" alt="User profile view highlighting language and region values"><figcaption></figcaption></figure>

If you choose to [overwrite the default values](https://doc.batch.com/web/custom-data/custom-locale) detected by the SDK with the language displayed on the website for this user, you can check that it is updated correctly using the Profile view on the dashboard (Profiles > Search Profiles) and your [Installation ID](https://doc.batch.com/guides-and-best-practices/message/push-notifications/how-to-send-a-test-push-notification-to-your-web-browser#h_17fa92f09d).

{% hint style="warning" %}
Use the **Refresh button** to see the latest data.
{% endhint %}
{% endstep %}
{% endstepper %}

## Case B: The permission prompt is not triggered on your website <a href="#h_cd4df78fd4" id="h_cd4df78fd4"></a>

In this case, check the following:

{% stepper %}
{% step %}

### Clear the data stored for your website <a href="#h_a230b707ca" id="h_a230b707ca"></a>

Make sure you [reset your browser preferences](https://doc.batch.com/guides-and-best-practices/profiles/how-to-reset-your-browser-opt-in-preferences) between each test.
{% endstep %}

{% step %}

### Staging domain name <a href="#h_5ad9b8bb02" id="h_5ad9b8bb02"></a>

<figure><img src="/files/IkOE2OkQALRYW4mZmzHp" alt="Allowing staging domains section"><figcaption></figcaption></figure>

If you deployed Batch on a staging version of your website, make sure you added your staging domain name to the list of "Allowed origins", from the dashboard Settings > Channels > Push > Website.
{% endstep %}

{% step %}

### Service worker <a href="#h_11dd75ed01" id="h_11dd75ed01"></a>

<figure><img src="/files/6yEjej7QBk5P54A9gRST" alt="Inspector section showing Batch service worker started"><figcaption></figcaption></figure>

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](http://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](https://doc.batch.com/developer/sdk/web/advanced/declare-path-service-worker#uploading-the-service-worker-to-a-folder-of-your-website)).\
In case you integrated it with an existing service worker, ensure you followed all steps of this [documentation](https://doc.batch.com/developer/sdk/web/advanced/integrating-batch-with-existing-service-worker).
{% endstep %}

{% step %}

### Unsecure environment <a href="#h_e7fa8e6c4c" id="h_e7fa8e6c4c"></a>

<figure><img src="/files/oySuPtJMrutNCh3BJA4f" alt="Unsecure website error message" width="563"><figcaption></figcaption></figure>

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.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/developer/technical-guides/how-to-guides/web/how-to-test-my-web-push-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
