# ProfitWell Web Device Mode Integration

RudderStack lets you send your event data to ProfitWell via the web [device mode]({{< ref "destinations/rudderstack-connection-modes.md#device-mode" >}}), that is, using the native web SDK.

## Connection compatibility

{{< destination-config >}}

## Get started

{{< info >}}
In the web device mode integration, that is, using [JavaScript SDK]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/_index.md" >}}) as a source, RudderStack loads the ProfitWell native SDK from the `https://public.profitwell.com/` domain. 

Based on your website's content security policy, you might need to [allowlist this domain]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk.md#allowlist-destination-domain" >}}) to load the ProfitWell SDK successfully.
{{< /info >}}

Once you have confirmed that the source platform supports sending events to ProfitWell, follow the steps below:

* From your [RudderStack dashboard](https://app.rudderstack.com/), add the source. From the list of destinations, select **ProfitWell**.
* Assign a name to the destination, and click **Next**. You will then see the following **Connection Settings** window:

{{< image src="images/event-stream-destinations/profitwell-connection.webp" alt="Profitwell connection settings" >}}

### Connection Settings

To successfully configure ProfitWell as a Device Mode destination, enter the following connection settings:

* **Public API Key**: Enter your ProfitWell public API key here. To obtain the **Public API Key**, log into your ProfitWell account. Then, navigate to the **Account Settings** - **Integration** option. Here, you can get your API key under [API Keys/Dev Kit](https://www2.profitwell.com/app/account/integrations), as shown in the following image:

{{< image src="images/event-stream-destinations/profitwell-key.webp" alt="Profitwell API key" >}}

{{< info >}}

The **Private API Key** field is **not** required if you want to send the events via device mode.
{{< /info >}}

* **Site Type**: Choose the site type from the dropdown. If the site type is **Web App**, then RudderStack will start the ProfitWell service either with `email` or `userId`. For the type **Marketing**, RudderStack will start the ProfitWell service anonymously.
* **Use device-mode to send events**: Enable this option to send events via the web [device mode]({{< ref "destinations/rudderstack-connection-modes.md#device-mode" >}}).

{{< warning >}}

The **Private API Key** field is **not** required if you want to send the events via device mode.
{{< /warning >}}

* Finally, click **Next** to complete the setup. ProfitWell should now be configured and enabled as a destination in RudderStack.

## Identify

For the **Web App** site type, the `identify` call will start the ProfitWell Service using the customer's `email`. If no email is provided, then RudderStack will start the service with the user's `userId`. For the **Marketing** type, RudderStack will start the ProfitWell service anonymously.

A sample `identify` call is as shown:

```javascript
  rudderanalytics.identify( "userId", {email: "sample@domain.com"});
```

For the `identify` call to trigger user engagements, you need to first create [Customers](https://www2.profitwell.com/app/customers) within ProfitWell.



