# Nanigans Destination

## Destination Info

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

### Components

* [Browser](https://github.com/segment-integrations/analytics.js-integration-nanigans)
* 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: yes
* mobile: yes
* server: yes

## Getting Started

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

* Nanigans starts automatically collecting data on your site.

## Track

In order for the `track` call to succeed, the requirements include a `userId` being set previously by an `identify` call.

For ecommerce events,(i.e. `purchase`) it is important that the `.track()` call also includes the below within `properties`:

* `orderId`
* `products` array, which contain objects that have `sku`, `quantity`, and `price`

More information about the semantic naming of our [ecommerce events](/docs/segment/connections/spec/ecommerce/v2/).

If the folks at Nanigans ask you pass through any custom parameters, you can map the Segment event properties to arbitrary querystring parameters as well. **Note:** This is currently only supported using the server-side destination, which is used for our mobile and server-side libraries.

## Server-Side

By default, if you are sending data using a mobile library, we will send the `IDFA` (iOS) or `Advertising ID` (Android) so that you can associate server side events with the anonymous users from your mobile app.

However, if you are sending events with a server side library, you can still manually pass the `IDFA` or `Advertising ID` under `context.device.advertisingId` and we will send it along to achieve the same effect.

## Mobile

By default, if you send any data with either the iOS or Android library, we will send that data to Nanigans required `/mobile.php` endpoint.

If you'd like to send any other server side event using a server side library, you can either enable the option "Send Events to Mobile Endpoint" in your Nanigans settings. However, this means that ALL server side events sent from your server side library will be sent to the mobile endpoint.

If you are unsure which endpoint to send to, contact Nanigans support!

## 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 Nanigans  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    |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| App ID                         | You can find your App ID in your Nanigans pixel; it's the xxx part of the app\_id=xxx parameter.                                                                                                                                                                  | Yes      | string  |
| Conversion events              | Use these fields to map your Segment event names to Nanigans event names. We'll only send Nanigans the conversion events you specify.                                                                                                                             | No       | mixed   |
| Facebook App ID                | You can find your Facebook App ID in your Nanigans pixel; it's the xxx part of the fb\_app\_id=xxx parameter.                                                                                                                                                     | No       | string  |
| Send Events to Mobile Endpoint | Select this option to send your data to Nanigans' mobile endpoint. Most projects (even mobile ones) don't need this option enabled; if you're unsure, check with your Nanigans contact. Note that if you set this option, you must also set your Facebook App ID. | No       | boolean |
