# Gainsight PX Web Device Mode Integration


After you have successfully [instrumented]({{< ref "destinations/streaming-destinations/gainsight-px/setup-guide.md" >}}) Gainsight PX as a destination in RudderStack, follow this guide to correctly send your events to Gainsight PX in the [web device mode]({{< ref "/destinations/rudderstack-connection-modes.md#device-mode" >}}).

{{< 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 Gainsight PX native SDK from the `https://web-sdk.aptrinsic.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 Gainsight PX SDK successfully.
{{< /info >}}

## Identify

Use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to identify a user in Gainsight PX. 

When you send an `identify` call, RudderStack passes that user’s information to Gainsight PX with `userId` as the Gainsight PX user ID and the user traits are mapped to the visitor metadata.

A sample `identify` call is shown:

```javascript
rudderanalytics.identify("1hKOmRA4el9Z", {
  email: "alex@example.com",
  name: "Alex Keener",
  gender: "Male",
  countryName: "USA",
  countryCode: "US",
  city: "New Orleans",
  score: 100,
  hobbyCustomField: "Painting",
  title: "Doctor",
})
```

## Track

The [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call lets you capture user events along with the associated properties.

A sample `track` call is shown:

```javascript
rudderanalytics.track("User Tracked", {
  description: "Sample user tracking event",
  status: "Demo",
})
```

## Group

You can use the [`group`]({{< ref "event-spec/standard-events/identify.md" >}}) call to create or update an account in Gainsight PX. 

When you send a `group` call, RudderStack sets the `groupId` as the  Gainsight PX account ID and maps the group traits to the account metadata.

{{< warning >}}
Your `group` calls must contain the `groupId` and `traits` if you are using your Gainsight PX account data.
{{< /warning >}}

A sample `group` call is shown:

```javascript
rudderanalytics.group("group18", {
  name: "Sample Group",
  industry: "Online Streaming",
  numberOfEmployees: 10000,
  website: "www.example-group.com",
  cultureCustomField: "customfield01",
})
```

<br />
