# Integrate PWA Kit with Data Cloud

To unify your customer data on Salesforce, connect your Progressive Web App (PWA) Kit storefront to [Data Cloud](https://help.salesforce.com/s/articleView?id=data.c360\_a_data_cloud.htm). After you set your store as a data source, Data Cloud receives engagement events, which are triggered by shopper activities in your storefront.
These engagement events are supported.

- `ViewPage` — A shopper views a page.
- `ViewProduct` — A shopper views a product detail page.
- `ViewCategory` — A shopper views a category or listing page.
- `ViewSearchResults` — A shopper performs a product search.
- `ViewRecommendations` — A shopper views personalized recommendations.

## Prerequisites

To use Data Cloud with PWA Kit, you must first set up your own production instance of Data Cloud. See [Get Started Using Data Cloud](https://help.salesforce.com/s/articleView?id=data.c360\_a_product_considerations.htm) in *Salesforce Help*.

## Send PWA Kit Events to Data Cloud

1. To connect your storefront to Data Cloud, complete the instructions from [Connect a Website or Mobile App to Data Cloud](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-set-up-mobile-web-connection.md) in the *Data Cloud Integration Guide*. When the New Connection window asks what you’re connecting to, select **A Custom Website**.
2. To start sending data from your storefront to Data Cloud, complete the instructions from [Create a Web or Mobile App Data Stream](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-mobile-web-datastream.md) in the *Data Cloud Integration Guide*.
3. Get the Data Cloud tenant ID.
   1. In Data Cloud, click ![Setup](https://a.sfdcstatic.com/developer-website/sfdocs/commerce-cloud/media/pwa-kit-managed-runtime/comm-setup-icon-no-border.png) at the top of the page, and then select **Data Cloud Setup**.
   2. In the Your Home Org Details section, copy and save the tenant ID from the tenant endpoint. The tenant ID is the string preceding the first period. For example, `<tenantId>.c360a.salesforce.com`.
4. Get the Data Cloud app source ID.
   1. Go back to Data Cloud Setup.
   2. In the Set Up Data Cloud section, click **Connect Other Data Sources | Website and Mobile App**.
   3. Select the connection for your PWA Kit storefront.
   4. In the Integration Guide section, copy and save the app source ID from the script. The app source ID is the string preceding /scripts. For example, `https://cdn.pc-rnd.c360a.salesforce.com/beacon/c360a/<appSourceId>scripts/c360a.min.js`.
5. Update your PWA Kit project’s [configuration file](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/configuration-options.md) with the Data Cloud tenant and app source IDs from steps 3 and 4. Here’s an example configuration file with the IDs populated:

```javascript
app: {
   dataCloudAPI: {
           appSourceId: 'fb81edab-24c6-4b40-8684-b67334dfdf32',
           tenantId: 'mmyw8zrxhfsg09lfmzrd1zjqmg'
   }
}
```

## Verify Event Retrieval

1. In Data Cloud, click **Data Explorer**.
2. Select a data space.
3. From the Object dropdown list, select **Data Model Object**.
4. In the object field, search for and select **Website Engagement**.
5. To personalize your data view, click **Edit Columns** and select the columns corresponding to the data points you want to view.
6. In your store‘s test environment, try out shopper activities: search for a product, view a product detail page, and so on.
7. Refresh your Data Explorer tab and verify that engagement event data appears.

For more information about how B2C Commerce storefronts can integrate with Data Cloud, see [Sending B2C Commerce Engagement Events to Data Cloud](https://help.salesforce.com/s/articleView?id=cc.b2c_data_cloud_send_engagement_events_container.htm) in *Salesforce Help*.
