# Web Push Notifications

To send web push notifications to your customers, you must first create the integration in the gopersonal admin and complete the configuration by following these steps:

## 1- Create the Web Push integration&#x20;

Go to Integrations and select Web push after Clicking New Integration.&#x20;

To authenticate a service account and authorize its access to Firebase services, you need to generate a private key file in JSON format.&#x20;

Follow these steps to generate a private key file for the service account:

* In the Firebase console, go to Settings > Service accounts.
* Click on Generate new private key, then click Generate key to confirm.
* Download the  JSON file and upload it in the Integration.&#x20;

## 2-  Add the Service Worker to your site&#x20;

The Service Worker (SW) is a JavaScript script that runs even when the browser is closed. This enables GoPersonal to send web push notifications to users with an active token, regardless of their online status. GoPersonal uses Firebase to send the push message to the SW, which then displays the notification to the user.

Follow this [link](https://admin.gopersonal.ai/gp-firebase.js), right-click, and select "Save As" to download the Service Worker file. Next, upload the Service Worker file to your domain’s subpath. The SW should be accessible at [www.yoursite.com/gp-firebase.js](http://www.yoursite.com/gp-firebase.js). If you need to use a different name, please let us know.&#x20;

## 3- Add your opt-in personalization&#x20;

To send web push notifications to your users, it's essential to obtain their consent and ensure they subscribe to receive them. We offer customizable templates that make it easy to add opt-in collectors to your site.


---

# 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://academy.gopersonal.ai/en/developers/channels-setup/web-push-notifications.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.
