# How to integrate Web Push with Salesforce Commerce Cloud?

Basic web push integration relies on two parts: adding a JavaScript tag to the pages of your website and uploading Batch's Service Worker to the root of your website.

If you are using Salesforce Commerce Cloud (SFCC) as a CRM for your website, you won't have access to the root of your website to upload Batch's Service Worker.

Here are the necessary steps to complete the web push integration with SFCC:

## 1. Add the Service Worker <a href="#id-1-add-the-service-worker" id="id-1-add-the-service-worker"></a>

{% stepper %}
{% step %}

### Create an SFCC object

First, you need to create an SFCC object with the type « Content Asset » (for example, "ServiceWorker-GetFile").

Then add the JavaScript content of the service worker (*batchsdk-worker-loader.js*) to the body of this object.

➡️ [**Download the Service Worker**](https://doc.batch.com/developer/sdk/web/getting-started/batch-service-worker)
{% endstep %}

{% step %}

### Create an alias of the route to the Service Worker <a href="#step-2-create-an-alias-of-the-route-to-the-service-worker" id="step-2-create-an-alias-of-the-route-to-the-service-worker"></a>

Create an entry in "Business Manager" → "Merchant Tools" → "SEO" → "Aliases".

<figure><img src="/files/unUxXjykdOdIXicelz6E" alt="Salesforce merchant tools list indicating where to find Aliases section"><figcaption></figcaption></figure>

This entry must route "/batchsdk-worker-loader.js" to the Content Asset created in Step 1 (e.g. "ServiceWorker-GetFile"):

```json
{   ...
    "your-host" : \[
    ...,     
    {       
    "if-site-path": "/batchsdk-worker-loader.js",
    "pipeline": "ServiceWorker-GetFile"     
    }   
  \]
}
```

The service worker should now be available here: <https://mywebsite.com/batchsdk-worker-loader.js>.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
In case the steps described above do not apply to you, here is a link where you can find other options: <https://help.salesforce.com/s/articleView?id=000391650&type=1>.
{% endhint %}

## 2. Add the JavaScript tag and test your integration <a href="#id-2--add-the-javascript-tag-and-test-your-integration" id="id-2--add-the-javascript-tag-and-test-your-integration"></a>

Once the Service Worker is added, you can complete the integration by following this guide: [How to implement Web Push with Batch?](/getting-started/other/implementation-guides/integration-steps-web.md)


---

# 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-integrate-web-push-with-salesforce-commerce-cloud.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.
