TUNE Destination

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, please reach out to their team.

This document was last updated on May 8, 2018. If you notice any gaps, outdated information or simply want to leave some feedback to help us improve our documentation, please let us know!

Getting Started

The first step is to make sure TUNE supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

WebMobileServer
📱 Device-based
☁️ Cloud-based
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “TUNE” within the Destinations Catalog and confirm the Source you’d like to connect 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, please follow the additional steps below to finish setting up!

iOS

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).

Xamarin

Xamarin.iOS

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:

ASIdentifierManager.SharedManager.AdvertisingIdentifier
ASIdentifierManager.SharedManager.IsAdvertisingTrackingEnabled

Xamarin.Android

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);

Identify

If you haven’t had a chance to review our spec, please take a look to understand what the Identify method does. An example call would look like:

analytics.identify({
  userId: '019mr8mf4r',
  traits: {
    name: 'Michael Bolton',
    email: 'mbolton@initech.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.

Track

If you haven’t had a chance to review our spec, please take a look to understand what the Track method does. An example call would look like:

analytics.track({
  "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": "2.1.1.4"
    },
    "library": {
      "name": "analytics-ios",
      "version": "1.6.11"
    },
    "locale": "en-US",
    "traits": {},
    "network": {
      "bluetooth": true,
      "carrier": "AT&T"
    },
    "ip": "70.128.91.158"
  }
})

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.

Server

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

Xamarin

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 EventTUNE Event
Product ViewedContent View
Product AddedAdd to Cart
Product Added to WishlistAdd to Wishlist
Checkout Step ViewedCheckout Initiated
Order CompletedPurchase

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.

Postbacks

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.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!