Unity Quick Start

Current Unity plugin version 7.0.0

The TUNE plugin for Unity provides application session and event logging functionality via the TUNE native SDKs. The TUNE plugin is compatible with Unity 5.3+.

To begin logging sessions and events, first integrate the Unity plugin with your mobile app. After you initiate the MeasureSession method, you can measure in-app events (such as purchases, game levels, and any other user engagement).

Important Note: Based on your platform, SDK initialization is necessary in the Native app code for Unity initialization. For iOS this is the Delegate class, for Android this is the Application class.

Supported TMC Solutions

The TUNE plugin for Unity supports the following TUNE Marketing Console solutions:

Downloading the Plugin

All of our extensions/plugins are open source and available on Github. To download the Unity plugin, please click the following link.

Unity plugin

NOTE: You must also download and install Google's Unity Jar Resolver plugin which resolves dependencies and performs version management.

Before you can download the TUNE plugin for Unity, make sure to add your app to the Attribution Analytics platform.


To implement the downloaded plugin:

  1. Open your Unity project.
  2. Go to Assets -> Import Package -> Custom Package and select the Tune.unitypackage to import.
  3. Attach a new C# script to a GameObject in your main scene.
  4. In your GameObject, click Add Component -> New Script.
  5. Edit the new script as follows:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using TuneSDK;
public class TuneScript : MonoBehaviour {
    void Awake() {
        Tune.Init("your_advertiser_ID", "your_conversion_key");
        // Check if a deferred deep link is available and handle opening of the deep link as appropriate in the success callback.
        // Uncomment the following line if your TUNE account has enabled deferred deep links
        // Tune.CheckForDeferredDeeplink();
        // Uncomment the following line to enable auto-measurement of successful in-app-purchase (IAP) transactions as "purchase" events
        // Tune.AutomateIapEventMeasurement(true);
        // Measure initial app open
    void OnApplicationPause(bool pauseStatus) {
        if (!pauseStatus) {
            // Measure app resumes from background

For an example implementation, you may refer to the following files:

  • Tune/Scenes/TUNESampleScene.unity
  • Tune/Scripts/TuneSample.cs

Configuration for Android

  • Building on Android will require JDK 1.8. You may tell Unity to use this from the menu option Unity -> Preferences -> External Tools -> JDK.
  • The sample/Assets/Plugins/Android folder includes a working example of AndroidManifest.xml. This example contains the necessary components for the TUNE plugin, simply modify it to suit your needs.

Advertising Identifiers

To increase the consistency and ease of attribution, the TUNE plugin for Unity collects device identifiers as described in Unique Identifiers for Attribution.


The Google Advertising ID is automatically collected by the Unity plugin. It requires the following:

  • google-play-services_lib folder or play-services-basement.aar file in Assets/Plugins/Android
  • Inside AndroidManifest.xml‘s <application> tag:
    <meta-data android:name="com.google.android.gms.version"
               android:value="@integer/google_play_services_version" />;

These will be automatically present with the above Android installation instructions.


The Apple Advertising ID is automatically collected by the Unity plugin.

Things to Keep in Mind

  • The “your_advertiser_ID” and the “your_conversion_key” values correlate with the Advertiser ID and Conversion Key that TUNE provides when you create your Mobile App in Attribution Analytics. For information about the advertiser ID and conversion key, please visit Finding Advertiser ID and Conversion Key.
  • Deferred deep linking functionality is only available in the TUNE plugin for Unity versions 3.11.0+. For information about deferred deeplinking, please visit Implementing a Deferred Deep Link.
  • If your app already has a pre-existing user base (people who have already installed your app), TUNE has several options to flag these users as Pre-Existing Users to prevent attributing these users to a marketing partner. For information about migrating existing users, please visit handle existing users prior to SDK implementation.
  • TUNE SDK v4.0+ for Android & v3.10+ for iOS automatically collects the geo location of the user's device to help improve location-based user segmentation. The location is collected only if the app has already requested and obtained end-user permissions; the TUNE SDK never asks for location access permission from the end-user. For more info, please visit Location Auto-Collection.

Testing & Troubleshooting

To test the Unity plugin implementation in your mobile app, you can do so straight from the Attribution Analytics platform itself rather than creating a test environment. Please visit Testing Your Mobile App.

Measuring Events

After you implement the TUNE plugin for Unity in your mobile app and start logging sessions, you can move on to logging a wide variety of in-app events such as registrations and in-app purchases.

By logging and analyzing in-app events, you can more efficiently optimize both the functionality of your app and your advertising strategies. Bottom line? Understanding how your users interact with your mobile app directly impacts your ability to build effective and profitable advertising campaigns by enabling you to compare retention, engagement, and lifetime value (LTV) to your costs.

Or to build your own custom event, please visit Event Builder.

In-App Events

Achievement Unlocked

Gaining access to additional functionality; generally by completion of a particular event or level.

Add to Cart

Including items in one's virtual shopping cart to be purchased.

Add to Wishlist

Including items in one's virtual list of wanted items not to be readily purchased.

Added Payment Info

Including one's payment information to be used for making purchases.

Checkout Initiated

Starting the checkout process once items have been added to one's cart and ready to complete the purchase.

Content View

Looking at or inspecting content on a page; essentially the rendering of the page.


Requesting someone to do something; for example, a friend invite or an app invite.

Level Achieved

Completing the necessary requirements to move on to the next stage; generally applies to gaming apps.


The process by which an individual gains access to their account by identifying and authenticating themselves.


Completing a purchase transaction in which one has bought an item.


Assigning a value to something according to a particular scale; e.g. 4 stars.


The act or process of entering information about one's self to create an account.


Arranging to have something (such as a table or seat) held for one's use at a later time.


Actively looking for or seeking out something via a keyword.


Giving others access to something; e.g. sending a link online content.

Spent Credits

Applying accumulated rewards/points as payment for an item.

Tutorial Complete

Finishing a lesson or instructions on how to do/achieve something.