# Refiner Web Device Mode Integration

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

## Identify

You can use the [`identify`]({{< ref "event-spec/standard-events/identify.md" >}}) call to create or update a contact in Refiner. RudderStack uses the `identifyUser` method to send this information to Refiner.

A sample `identify` call is shown below:

```javascript
rudderanalytics.identify("1hKOmRA4GRlm", {
  name: "Alex Keener",
  email: "alex@example.com"
})
```

{{< warning >}}
`userId` is required to make an `identify` call successfully. 
{{< /warning >}}

### Supported mappings

The following table lists the RudderStack attributes and their mappings with the Refiner properties:

| RudderStack property   | Refiner property  | 
| :-------------| :-----------------| 
| `userId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `id` |
| `properties.email` | `email` |
| `context.traits` | traits |

## Track

The [`track`]({{< ref "event-spec/standard-events/track.md" >}}) call lets you capture user events and send them to Refiner as `trackEvent` events.

{{< warning >}}
Refiner does not store any additional properties sent with the `track` event.
{{< /warning >}}

A sample `track` call is shown below:

```javascript
rudderanalytics.track("Order Completed", {
  orderId: "ORD122",
  price: "5.67",
  currency: "USD",
});
```

The following table lists the RudderStack properties and their mappings with the Refiner properties:

| RudderStack property   | Refiner property  | 
| :-------------| :-----------------| 
| event name <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | event |

## Group

The [`group`]({{< ref "event-spec/standard-events/group.md" >}}) call lets you link an identified user with a group, such as a company, organization, or an account. Note that Refiner associates all `group` traits with the `account` object associated with the user.

A sample `group` call is shown below:

```javascript
rudderanalytics.group("group@123", {
  name: "Sample Company",
  employees: 1000,
  industry: "Software",
})
```

The following table lists the RudderStack properties and their mappings with the Refiner properties:

| RudderStack property   | Refiner property  | 
| :-------------| :-----------------| 
| `userId` <br/> <span style="color: #4D4DFF;font-size:12px;">Required</span> | `id` |
| `traits.email` | `account.email` | 
| `context.traits.email` | `email` |
| `groupId` | `account.id` |
| `traits` | `account` |

## Page

The [`page`]({{< ref "event-spec/standard-events/page.md" >}}) call lets you record your website's page views with any additional relevant information about the viewed page and send this information to Refiner.

{{< info >}}
The behavior of the `page` call is the same as the []({{< ref "#track" >}}) call described above.
{{< /info >}}

A sample `page` event is shown below:

```javascript
rudderanalytics.page("Cart", "Cart Viewed", {
  path: "/cart",
  referrer: "samplewebsite.com",
  search: "some item",
  title: "New Item",
  url: "http://samplewebsite.in",
})
```
