TUNE Destination

TUNE quick info

TUNE accepts Track, and Identify calls. If you reference it in the Integrations object, call it “TUNE", or "MobileAppTracking”.

TUNE accepts data in cloud-mode from mobile and server sources, and can accept data in device-mode from mobile sources.

TUNE helps attribute mobile app events to the advertisements that a customer interacted with. We take care of sending those mobile events to TUNE so that they can be reconciled with ad views. The attributed data can then be routed back into other tools that you have enabled in Segment.

This destination is maintained by TUNE. Their code is publicly available for iOS and Android. For any issues with the destination, contact the TUNE Support team.

Getting Started

Before you start, make sure TUNE supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.

Web Mobile Server
📱 Device-mode ⬜️ ⬜️
☁️ Cloud-mode ⬜️
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “TUNE” in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. Add your TUNE Advertiser ID in the Segment Settings UI from your TUNE Dashboard.
  4. In your TUNE account, ensure that you have created a new app by navigating to Applications > Apps > Add A New App.
  5. Depending on library you’ve installed, follow the additional steps below to finish setting up!


When using our iOS library, make sure you are using the AdSupport Framework. You can verify this by checking if context.device.advertisingId (formerly context.device.idfa) is getting set in your source’s debugger (check raw format).



For iOS apps built with Xamarin, you need to set the context.device.advertisingId field to the Apple advertising identifier, and the context.device.adTrackingEnabled boolean to indicate whether ad tracking is supported.

You can retrieve these values by adding the following directive to your .cs file:

using MonoTouch.AdSupport;

And access the values as:



For Android apps built with Xamarin, you first need to add the Google Play Services component through the Xamarin Component Store by navigating to Project > Get More Components.

You then need to set the context.device.advertisingId field to the Google Advertising ID.

using Android.Gms.Ads.Identifier;
using Android.Gms.Common;
AdvertisingIdClient.Info adInfo = AdvertisingIdClient.GetAdvertisingIdInfo(this.ApplicationContext);


If you’re not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:

  userId: '019mr8mf4r',
  traits: {
    name: 'Michael Bolton',
    email: 'mbolton@example.com',
    plan: 'Enterprise',
    friends: 42

If your app has user accounts, you may want to identify these users when they login. This will appear in TUNE as a Login event.


If you’re not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:

  "userId": "abcd9435db2d4b53c94fb4b688a63fab",
  "event": "Opened App"
  "properties": {},
  "context": {
    "device": {
      "manufacturer": "Apple",
      "model": "iPhone7,2",
      "idfv": "A3D261E4-DE0A-470B-9E4A-720F3D3D22E6",
      "type": "ios"
    "os": {
      "name": "iPhone OS",
      "version": "8.1.1"
    "app": {
      "name": "Test App",
      "namespace": "com.segment.testapp",
      "version": "2.1.1",
      "build": ""
    "library": {
      "name": "analytics-ios",
      "version": "1.6.11"
    "locale": "en-US",
    "traits": {},
    "network": {
      "bluetooth": true,
      "carrier": "AT&T"
    "ip": ""

You can track the effectiveness of a mobile ad campaign by tracking key conversion events. This destination recognizes six special events (listed below), as well as any custom events you wish to track.


When sending your data server-side, contextual fields context.app.namespace and context.device.advertisingId must be manually sent in all calls.


When sending your data using our Xamarin library, contextual fields context.app.namespace and the boolean context.device.adTrackingEnabled must be manually sent in all calls.

Opened App

Install attribution is the most common use case for mobile attribution tools. To send this event to TUNE, send a track call from your mobile application when the app is opened with the event name Opened App. TUNE will take care of determining whether this is a first-time install, open, or update.

Special Events

TUNE supports special events beyond install attribution which are mapped to the Segment Ecommerce Spec:

Segment Event TUNE Event
Product Viewed Content View
Product Added Add to Cart
Product Added to Wishlist Add to Wishlist
Checkout Step Viewed Checkout Initiated
Order Completed Purchase

If you send an event with a name not included in the list above, Segment will send it to TUNE as a generic conversion event. You can then assign those events to pre-defined event categories in TUNE.


In addition to sending data to TUNE to be attributed, Segment allows you to route that data back into other tools that you have enabled. For example, you might want to use a particular analytics tool’s dashboards to compare the different channels of your mobile ad campaign. To do this, enable postbacks in TUNE and provide them with your source write key, as explained in TUNE’s documentation.


You can send computed traits and audiences generated using Segment Personas to this destination as a user property. To learn more about Personas, contact us for a demo.

For user-property destinations, an 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, Personas 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), Personas sets that value to false.

When you first create an audience, Personas 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.


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

Advanced Event Property Mappings

If you have any event properties that you would like to map to TUNE custom event attributes on a per-event basis, you can specify them here.

Advertiser ID

You can find your Advertiser ID in your TUNE account under Accounts > Advertiser Account

Consumer Key

Required for Server to Server Integration. This is the public key that will be included with each request so the Private Key used to create the signature can be identified. Please contact your TUNE account manager to get your consumer key.

Conversion Key

Required for Client Side Integration. You can find your Conversion Key in your TUNE account.

Custom Event Attributes

If you have any event properties that you would like to map to TUNE custom event attributes for all events, please specify them here. You may override any of these on a per-event basis in Advanced Settings.

Custom Item Attributes

If you have any product properties that you would like to map to item-scoped custom attributes inside site_event_items for your ecommerce events, please specify them here.

Private Key

Required for Server to Server Integration. This is the Private key that will be used to generate the signature on both the client and server but will not be included in the request. Please contact your TUNE account manager to get your private key.

TUNE Predefined Event Mapping

Use this setting to map your Segment events to TUNE’s pre-defined event mappings. Input your Segment event on the left-hand side, and select the TUNE event you want to send it as from the dropdown.

TUNE’s documentation: https://developers.tune.com/measurement-docs/measuring-pre-defined-events/

Adding TUNE to the integrations object

To add TUNE to the integrations JSON object (for example, to filter data from a specific source), use one of the following valid names for this integration:

  • TUNE

  • MobileAppTracking

This page was last modified: 20 Oct 2020

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
Create free account