TUNE Destination

Segment makes it easy to send your data to TUNE (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to TUNE in the format they understand. Learn more about how to use TUNE with Segment.

Tune’s main goal is to help attribute mobile app events to the advertisements that a customer interacted with. We take care of sending those mobile events to MAT 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.

Getting Started

Once you’re tracking data from one of our mobile libraries, toggle Tune on in your Segment destinations, and add your application’s Tune Advertiser ID in the Segment Destinations Page. In your Tune account, ensure that new apps are created dynamically by selecting ‘Enabled’ under Application > Settings > Create New Apps Dynamically.

SDK version

The MAT integration requires that a package name / bundle identifier be sent in all calls. To meet this requirement, ensure that you are using our latest Android SDK (3.0.1+) and our iOS SDKs (1.11.12+). On Android and iOS, this will automatically add the context.app.namespace parameter to your calls, which represents the developer name of your mobile application. In Xamarin, however, you have to populate this value manually. A sample call in node.js may 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"
  }
})

Track

To track the effectiveness of a mobile ad campaign, you’ll want to track key conversion events. For example, you might want to track when your app is opened for the first time to measure install attribution. This destination recognizes six special events (listed below), as well any custom events you wish to track.

Opened App

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

Viewed Product

Viewed Product is a special event from our e-commerce API. This will appear in MAT as a Content View event.

Added Product

Added Product is a special event from our e-commerce API. This will appear in MAT as an Add to Cart event.

Wishlisted Product

Wishlisted Product is a special event from our e-commerce API. This will appear in MAT as an Add to Wishlist event.

Viewed Checkout

Viewed Checkout is a special event from our e-commerce API. This will appear in MAT as a Checkout Initiated event.

Completed Order

Order Completed is a special event from our e-commerce API. This will appear in MAT as a Purchase event.

Other

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

Identify

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

Postbacks

In addition to sending data to MAT 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 MAT and provide them with your source write key, as explained in Tune’s documentation.

Troubleshooting

iOS Setup

To ensure that our iOS SDK is properly sending device information, 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 Setup

Because device-specific information is automatically sent in the track.context dictionary, MAT is able to attribute events like app installs and re-engagement. On iOS and Android devices, this device information is picked up automatically by the Segment SDK. Our Xamarin library, however, is a Portable Class Library, which means that it cannot access the same information as the native libraries. This requires a little more work to get it working.

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

An example track call might look like this:

Analytics.Client.Track("019mr8mf4r", "Opened App", new Properties() { ... }, new Options()
    .SetContext(new Context() {
        { "device", new Dict() {
            { "advertisingId", ASIdentifierManager.SharedManager.AdvertisingIdentifier },
            { "adTrackingEnabled", 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 (Project -> Get More Components). You then need to set the context.device.advertisingId field to the Google Advertising ID and context.device.adTrackingEnabled to the ad tracking boolean for each call.

using Android.Gms.Ads.Identifier;
using Android.Gms.Common;

AdvertisingIdClient.Info adInfo = AdvertisingIdClient.GetAdvertisingIdInfo(this.ApplicationContext);

Analytics.Client.Track("019mr8mf4r", "Opened App", new Properties() { ... }, new Options()
    .SetContext(new Context() {
        { "device", new Dict() {
            { "advertisingId", adInfo.Id },
            { "adTrackingEnabled", adInfo.IsLimitAdTrackingEnabled } }
    }));

Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

Segment offers an optional Device-based Connection Mode for Mobile data with TUNE. If you’d like to use those features that require client-based functionality, follow the steps above to ensure you have packaged the TUNE SDK with Segment’s.

Settings

Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

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.

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.

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.

Advertiser ID

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

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.

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.


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!