# Woopra Destination

## Destination Info

* Accepts [Page](/docs/segment/connections/spec/page), [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **Woopra** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)

### Components

* Browser
* Server

## Connection Modes

[Learn more about connection modes.](/docs/segment/connections/destinations/#connection-modes)

### Device-Mode

* web: yes
* mobile: no
* server: no

### Cloud-Mode

* web: no
* mobile: yes
* server: yes

Segment's Woopra destination code is open-source on GitHub:

* [Javascript](https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/woopra)

## Getting Started

When you enable Woopra in the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loading Woopra's javascript onto your page. This means you should remove Woopra's snippet from your page.

* Woopra starts automatically collecting data on your site.

Woopra is supported on client-side and server-side.

## Page

When you call `.page()` in the browser, Segment passes the properties of the page such as `url`, `referrer`, `path`, and etc. If you pass a `name` in your `.page()` call, Segment sends that as `title` to Woopra.

> \[!NOTE]
>
> `.page()` calls are not supported when sending those events server side or using mobile libraries.

## Identify

### Client Side

When you call `identify` on analytics.js, Segment calls Woopra's `woopraTracker.addVisitorProperty` for each trait that you pass in. These traits are stored in the Woopra cookie, and will be sent on the next page load.

### Server Side

When you call `identify` from the server-side languages, Segment calls Woopra's [HTTP REST API](https://docs.woopra.com/reference/intro-http-tracking) with the traits that you pass in.

## Group

Woopra does not accept data sent using the Segment `group` method.

## Track

### Client Side

When you call `track` on analytics.js, Segment calls Woopra's `woopraTracker.pushEvent` with the a single `settings` object where the `event` parameter you pass is set as `settings.name` for the Woopra event.

### Server Side

When you call `track` from the server-side languages, Segment calls Woopra's HTTP REST API with the event properties that you pass in.

The default Woopra `online` [timeout](https://docs.woopra.com/reference/intro-http-tracking) is set to 60 seconds, but is adjustable with `context.Woopra.timeout`.

## Features

### Tying server side events to client side sessions

If you want your server side events to be seen as part of the same "source" or session as your client side events, all you have to do is pass the `wooTracker` value inside your cookie. Luckily, you can easily retrieve this value by:

```js
analytics.ready(function(){
  var woopraCookie = window.woopra.cookie;

  // pass this value to your server
});
```

For server-side integrations, you can attach it to the `integrations.Woopra.cookie` property:

(Ruby example)

```ruby
Analytics.track(
    user_id: '019mr8mf4r',
    event: 'Purchased Item',
    properties: { revenue: 39.95, shipping: '2-day' },
    integrations: {
      Woopra: {
       cookie: <wooTracker value>
      }
    })
```

This should let Woopra know that this server side event is part of the same session as the client. *Important*: Make sure `Woopra` is capitalized!

## Troubleshooting

### Split user profiles

If you are seeing split user profiles, the most likely culprit is that you are calling `.identify()` only on the backend using one of Segment's server side libraries but **NOT** on the client side with `analytics.js`.

Calling `.identify()` in the browser will effectively map the `userId` you passed in with the `wooTracker` cookie value. So in the event that you call `.identify()` on the server side first, you **MUST** call `.identify()` on the client side as well to tie the `wooTracker` cookie to that `userId`.

Doing so will ensure that duplicate profiles are not created.

## Engage

You can send computed traits and audiences generated using [Engage](/docs/segment/engage) to this destination as a **user property**. To learn more about Engage, schedule a [demo](https://segment.com/contact/demo).

For user-property destinations, an [identify](/docs/segment/connections/spec/identify/) call is sent to the destination for each user being added and removed. The property name is the snake\_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property `order_completed_last_30days: true`. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to `false`.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

> \[!NOTE]
>
> Real-time audience syncs to Woopra  may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

## Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

| Field                      | Description                                                             | Required | Type    |
| -------------------------- | ----------------------------------------------------------------------- | -------- | ------- |
| Click Tracking             | Automatically track button and link clicks                              | No       | boolean |
| Cookie Domain              | Domain scope of the Woopra cookie                                       | No       | string  |
| Cookie Name                | Name of the cookie to identify the visitor.                             | No       | string  |
| Cookie Path                | Directory scope of the Woopra cookie                                    | No       | string  |
| Domain                     | This is the name of your project in \[Woopra]\(https://www.woopra.com). | Yes      | string  |
| Download Tracking          | Track downloads on the web page                                         | No       | boolean |
| Hide Campaign              | Enable if you want woopra to hide campaign properties from the URL      | No       | boolean |
| Idle Timeout               | Idle time after which the user is considered offline                    | No       | number  |
| Ignore Query URL           | Ignores the querystring when you \`page()\`                             | No       | boolean |
| Outgoing Ignore Subdomains | Do not include links to subdomains as outgoing links                    | No       | boolean |
| Outgoing Tracking          | Track external links clicks on the web page                             | No       | boolean |
