1) Android Integration

To apply T-MAT, be sure that you already finished both adding your app and SDK settings.

[Basic settings]
  • Put the tnkad_tracking value as 'true' in <meta-data/> inside of <application/> tag at AndroidMenifest.xml file.
  • If you don't want to use T-MAT anymore, just simply change the value to 'false'.

App ID & Tracking option

<application>
    ...
    <meta-data android:name="tnkad_app_id"  android:value="your-app-id-from-tnk-sites" />
    <meta-data android:name="tnkad_tracking" android:value="true" />
    ...
 </application>

To collect channel data, you have to add a <receiver/> tag for INSTALL_REFERRER.

Referrer Receiver

<application>
    ...

    <receiver android:name="com.tnkfactory.ad.TnkReceiver" android:exported="true">

        <intent-filter>

            <action android:name="com.android.vending.INSTALL_REFERRER" />

        </intent-filter>

   </receiver>
    ...

</application>


Check if you put <user-permission/> as follows. Add <user-permission/> tags if you didn't yet.

Permissions

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Set minSdkVersion to 9 or greater.

minSdkVersion

<uses-sdk android:minSdkVersion="9" />

AndroidMenifest.xml file may look like as follows.

AndroidMenifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapplication" android:versionCode="110" android:versionName="1.10" >

    <uses-sdk android:minSdkVersion="9"/>

    <uses-permission android:name="android.permission.INTERNET" /> 

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />       

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <application android:icon="@drawable/ic_launcher" android:label="@string/app_name"

        ... your activities ...

        <receiver android:name="com.tnkfactory.ad.TnkReceiver" android:exported="true"

            <intent-filter>

                <action android:name="com.android.vending.INSTALL_REFERRER" /> 

            </intent-filter>

        </receiver>

        <meta-data android:name="tnkad_app_id" android:value="your-app-id-from-tnk-sites" />

        <meta-data android:name="tnkad_tracking" android:value="true" />    

    </application>

</manifest


[Required Invocation]

Invoke this method as soon as your app is started. This is a minimum requirement for analytics.

Method
  - void TnkSession.applicationStarted(Context context)

Description
   Call when application is started. This should be called prior to any other API.

Parameters
 Name Description
 contextActivity or Context object


[Funnel Analytics]

Call below API to receive data about depth of user action. For example, action such as log- in, item purchase and recommendation can be called.

Method
  - void TnkSession.actionCompleted(Context context, String actionName)

Description
   Call when specific action is made, First occurrence for each action is collected.

Parameters
 Name Description
 contextActivity or Context object
 actionNameString representing user action( "user_login" for example)
You must register this name in the page of Funnel Analytics of Report menu at Tnk site.

actionCompleted Samples

// resource data downloaded

TnkSession.actionCompleted(this, "resource_loaded");

// signed up 

TnkSession.actionCompleted(this, "signup_completed");

// profile entered

TnkSession.actionCompleted(this, "profile_entered");

// friend invitation 

TnkSession.actionCompleted(this, "friend_invite"); 


[User Information]

If you set user demographic, you can find more informative data. 

Setting Users Info

// age

TnkSession.setUserAge(this,23);

// man 

TnkSession.setUserGender(this,TnkCode.MALE);

// woman

TnkSession.setUserGender(this,TnkCode.FEMALE); 



Comments