- Quick start guide
- Integrate and Initialize the Trackier SDK
- Events Tracking
- Deeplinking
- Getting Campaign Data
We have created a example app for the Unity SDK integration.
Please check the Example directory for know to how the Trackier SDK
can be integrated.
Unity SDK is very easy to integrate in your app. Just need to follow some steps
To integrate the Trackier SDK into your Unity project, follow these steps.
Get the SDK As of version 1.6.57 you can download the latest version from our releases page.
Add the SDK to your project Open your project in the Unity Editor, go to Assets → Import Package → Custom Package and select the downloaded Unity package file.
For initialising the Trackier SDK. First, We need to generate the SDK key from the Trackier MMP panel.
Following below are the steps to retrieve the SDK key:-
- Login your Trackier Panel
- Select your application and click on Action button and login as
- In the Dashboard, Click on the
SDK Integration
option on the left side of panel. - under on the SDK Integration, You will be get the SDK Key.
After follow all steps, Your SDK key look like the below screenshot
Screenshot[1]
Integrate the SDK into your app
Initialize Trackier SDK :- After importing package successfully, you would be seeing a Trackier named folder in which you will find Trackier.cs file.
In the following line add your app_token.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using com.trackier.sdk;
namespace com.sampleapp
{
public class Script : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
/*While Initializing the SDK, You need to pass the two arguments in the TrackierSDKConfig.
you need to pass the Trackier SDK api key in the argument */
/* Initialize SDK */
TrackierConfig trackierConfig = new TrackierConfig("e69b921c-bbe8-xxxx-xxxx-5a9678abffea", "development"); //Pass SDK key and environment
trackierConfig.setAppSecret("6419510xxxxxxxa686cf1", "MzgwYWMwOTQt6xxxxxxxxxxxxxxtZTk3MTMwNTMzMjQ5");
TrackierUnity.initialize(trackierConfig);
}
// Update is called once per frame
void Update()
{
}
}
}
Screenshot[2]
Trackier events trackings enable to provides the insights into how to user interacts with your app. Trackier SDK easily get that insights data from the app. Just follow with the simple events integration process
Trackier provides the Built-in events
and Customs events
on the Trackier panel.
Predefined events are the list of constants events which already been created on the dashboard.
You can use directly to track those events. Just need to implements events in the app projects.
Screenshot[3]
/*
* Event Tracking
<------------->
* The below code is the example to pass a event to the Trackier SDK.
* This event requires only 1 Parameter which is the Event ID.
* Below are the example of built-in events function calling
* The arguments - "TrackierEvent.LOGIN" passed in the Trackier event class is Events id
*
*/
public class Script : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
/*While Initializing the SDK, You need to pass the two arguments in the TrackierSDKConfig.
you need to pass the Trackier SDK api key in the argument */
/* Initialize SDK */
TrackierConfig trackierConfig = new TrackierConfig("e69b921c-bbe8-xxxx-xxxx-5a9678abffea", "development"); //Pass SDK key and environment
trackierConfig.setAppSecret("6419510xxxxxxxa686cf1", "MzgwYWMwOTQt6xxxxxxxxxxxxxxtZTk3MTMwNTMzMjQ5");
TrackierUnity.initialize(trackierConfig);
/* Event Track */
/*
* Event Tracking
<------------->
* The below code is the example to pass a event to the Trackier SDK.
* This event requires only 1 Parameter which is the Event ID.
* Below are the example of built-in events function calling
* The arguments - "sEMWSCTXeu" passed in the Trackier event class is Events id
*/
TrackierEvent trackierEvent = new TrackierEvent("sEMWSCTXeu"); //pass your eventid here
trackierEvent.param1 = "param";
TrackierUnity.trackierEvent(trackierEvent);
}
// Update is called once per frame
void Update()
{
}
}
Note:- Argument in Trackier event class is event Id.
You can integrate inbuilt params with the event. In-built param list are mentioned below:-
orderId, revenue, currency, param1, param2, param3 ,param4, param5, param6, param7, param8, param9, param10.
Below are the screenshot of following example
Screenshot[4]
Customs events are created by user as per their required business logic.
You can create the events in the Trackier dashboard and integrate those events in the app project.
Screenshot[5]
public class Script : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
/*While Initializing the SDK, You need to pass the two arguments in the TrackierSDKConfig.
you need to pass the Trackier SDK api key in the argument */
/* Initialize SDK */
TrackierConfig trackierConfig = new TrackierConfig("e69b921c-bbe8-xxxx-xxxx-5a9678abffea", "development"); //Pass SDK key and environment
trackierConfig.setAppSecret("6419510xxxxxxxa686cf1", "MzgwYWMwOTQt6xxxxxxxxxxxxxxtZTk3MTMwNTMzMjQ5");
TrackierUnity.initialize(trackierConfig);
/* Event Track */
/*
* Event Tracking
<------------->
* The below code is the example to pass a event to the Trackier SDK.
* This event requires only 1 Parameter which is the Event ID.
* Below are the example of built-in events function calling
* The arguments - "sEMWSCTXeu" passed in the Trackier event class is Events id
*/
TrackierEvent trackierEvent = new TrackierEvent("sEMWSCTXeu"); //pass your eventid here
trackierEvent.param1 = "param";
TrackierUnity.trackierEvent(trackierEvent);
}
// Update is called once per frame
void Update()
{
}
}
Below are the screenshot of above code snippet
Screenshot[6]
Trackier allow user to pass the revenue data which is generated from the app through Revenue events. It is mainly used to keeping record of generating revenue from the app and also you can pass currency as well.
public class Script : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
/*While Initializing the SDK, You need to pass the two arguments in the TrackierSDKConfig.
you need to pass the Trackier SDK api key in the argument */
/* Initialize SDK */
TrackierConfig trackierConfig = new TrackierConfig("e69b921c-bbe8-xxxx-xxxx-5a9678abffea", "development"); //Pass SDK key and environment
trackierConfig.setAppSecret("6419510xxxxxxxa686cf1", "MzgwYWMwOTQt6xxxxxxxxxxxxxxtZTk3MTMwNTMzMjQ5");
TrackierUnity.initialize(trackierConfig);
/* Event Track */
/*
* Event Tracking
<------------->
* The below code is the example to pass a event to the Trackier SDK.
* This event requires only 1 Parameter which is the Event ID.
* Below are the example of built-in events function calling
* The arguments - "sEMWSCTXeu" passed in the Trackier event class is Events id
*/
TrackierEvent trackierEvent = new TrackierEvent("sEMWSCTXeu"); //pass your eventid here
trackierEvent.param1 = "param";
trackierEvent.revenue = 8.0; //pass your revenue here
trackierEvent.currency = "Inr"; //pass your currency here
TrackierUnity.trackierEvent(trackierEvent);
}
// Update is called once per frame
void Update()
{
}
}
IDictionary<int, object> eventCustomParams = new Dictionary<int, object>();
numberNames.Add(customParam1,XXXXX);
numberNames.Add(customParam2,XXXXX);
trackierEvent.ev = eventCustomParams;
TrackierUnity.TrackEvent(trackierEvent);
Deep linking is a techniques in which the user directly redirect to the specific pages of the application by click on the deeplink url.
There are two types deeplinking
-
Normal deeplinking - Direct deep linking occurs when a user already has your app installed on their device. When this is the case, the deep link will redirect the user to the screen specified in the link.
-
Deferred deeplinking - Deferred deep linking occurs when a user does not have your app installed on their device. When this is the case, the deep link will first send the user to the device app store to install the app. Once the user has installed and opened the app, the SDK will redirect them to the screen specified in the link.
Please check below the Deeplinking scenario
If a user already has your app on their device, it will open when they interact with a tracker containing a deep link. You can then parse the deep link information for further use. To do this, you need to choose a desired unique scheme name.
You can set up a specific activity to launch when a user interacts with a deep link. To do this:
- Assign the unique scheme name to the activity in your AndroidManifest.xml file.
- Add the intent-filter section to the activity definition.
- Assign an android:scheme property value with your preferred scheme name.
For example, you could set up an activity called FirstActivity to open like this:
<activity
android:name=".Activity.FirstProduct"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="trackier.u9ilnk.me"
android:pathPrefix="/product"
android:scheme="https" />
</intent-filter>
</activity>
https://trackier.u9ilnk.me/product?dlv=FirstProduct&quantity=10&pid=sms
There is a Universal Links iOS app opening method which needs to be implemented for deeplink to work. This method directly opens the mobile app at default activity. Universal links take the format of normal web links for example. https://yourbrand.com or https://yourbrand.u9ilnk.me
Follow the steps for configuring Universal Links
a. Getting the app bundle ID and prefix ID
- Log into your Apple Developer Account.
- On the left-hand menu, select Certificates, IDs & Profiles.
- Under Identifiers, select App IDs.
- Click the relevant app.
- Copy the prefix ID and app bundle ID and insert in app settings page in Trackier MMP.
Screenshot[9]
b. Adding the prefix ID and app bundle ID in the Trackier MMP.
- Login your Trackier Panel
- Select your application and click on Action button and login as
- In the Dashboard, Click on the
UniLink
option on the left side of panel. - On the Unilink page, create template by click on Action button which is located on the right side header of the page.
- After creating template, Edit that template by click on the edit button.
- On the edit template page, Add the prefix ID and app bundle ID in the Link Behaviour (When application is installed)
Please check the screenshot for the reference
Screenshot[10]
c. Configure mobile apps to register associated domains
Configuring mobile apps to register approved domains takes place inside Xcode. It requires the unilink subdomain that you can get from app setting page in Trackier MMP.
- Follow this iOS instructions
- Get the unilink subdomain from app settings page in Trackier MMP.
- In Xcode, click on your project. Click on the project target.
- Switch to Capabilities tab.
- Turn on Associated Domain.
- Add the unilink subdomain that you got from Trackier MMP.
- The format is applinks:subdomain.unilink.me. Add applinks: before the domain as like
applinks:subdomain.unilink.me
Screenshot[11]
To associate a domain with your app, you need to have the associated domain file on your domain and the appropriate entitlement in your app. Once the unilink is created, Trackier hosts the apple-app-site-association file. When a user installs your app, the system attempts to download the associated domain file and verify the domains in your Associated Domains Entitlement.
Deferred deep linking happened, when a user does not have your app installed on their device. When the user clicks a trackier URL, the URL will redirect them to the Play Store to download and install your app. When the user opens the app for the first time, the SDK will read the deeplink content.
For get deeplink content information, set a callback method on the TrackierConfig object. This will receive the parameters where the content of the URL is delivered. Set this method on the config object by calling the method setDeferredDeeplinkDelegate:
Below are the example of the code :-
using UnityEngine;
using System.Collections;
using com.trackier.sdk;
using System;
public class NewMonoBehaviour : MonoBehaviour
{
// Use this for initialization
void Start()
{
TrackierConfig trackierConfig = new TrackierConfig("abcf2270-xxxxxxxxxx-34903c6e1d53", "development");
trackierConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback); // Pass for setting the deferred deeplinking
TrackierUnity.initialize(trackierConfig);
Debug.Log("AppKey Initialized");
}
// Update is called once per frame
void Update()
{
}
private void DeferredDeeplinkCallback(string deeplinkURL)
{
Debug.Log("Deferred deeplink reported!");
if (deeplinkURL != null)
{
Debug.Log("Deeplink URL: " + deeplinkURL); // Getting the deeplink url.
}
else
{
Debug.Log("Deeplink URL is null!");
}
}
}
For getting the campaign data, We have a function that return the campaign data. Please check below the example code.
TrackierEvent trackierEvent = new TrackierEvent(TrackierEvent.PURCHASE);
string ad = TrackierUnity.getAd();
string adID = TrackierUnity.getAdID();
string adSet = TrackierUnity.getAdSet();
string adSetID = TrackierUnity.getAdSetID();
string campaign = TrackierUnity.getCampaign();
string campaignID = TrackierUnity.getCampaignID();
string channel = TrackierUnity.getChannel();
string clickId = TrackierUnity.getClickId();
string p1 = TrackierUnity.getP1();
string p2 = TrackierUnity.getP2();
string p3 = TrackierUnity.getP3();
string p4 = TrackierUnity.getP4();
string p5 = TrackierUnity.getP5();
string dlv = TrackierUnity.getDlv();
string pid = TrackierUnity.getPid();
string retargetting = TrackierUnity.getIsRetargeting();
TrackierUnity.TrackEvent(trackierEvent);