Mobile SDK

Monetise your mobile app activity with our SDK.

Overview

Tradedoubler's mobile Software Development Kit (SDK) extends your earning potential to apps. Whether you drive traffic from mobile web or in-app the SDK allows you to:

  • Earn revenue for app downloads on a CPI basis.
  • Be rewarded for quality traffic with CPA/CPL commission on in-app activity.
  • Benefit from increased conversion rates by driving users to already installed advertiser apps.
  • Earn on purchases, registrations, game achievements and much more.

The mobile SDK supports the Android and iOS platforms. They include all the benefits of Tradedoubler's accurate and secure tracking with mobile specific additions.


Do not have a publisher account? Register with Tradedoubler and get started today!


This documentation is intended for publishers. If you are an advertiser, go to the advertiser documentation.

Features

Our world-class tracking accuracy, robustness and security available for advertisers' desktop and mobile sites is mirrored in our mobile SDK. No matter where you drive traffic from - desktop site, mobile site or app - Tradedoubler's SDK will track the app download and subsequent in-app activity.

The SDK operates differently depending on the platform (iOS or Android) but the functionality remains the same.

App Download Tracking

App Download Tracking (ADT) allows you to drive app installs and earn commission on a CPI basis.

Once the download has taken place quality traffic will often result in post-download activity. This could include in-app purchases, reaching a certain game level or registering for a service. ADT allows you to earn commission on a CPA/CPL basis meaning you have a long-term revenue stream from mobile apps.

Now you can go even further in monitising your mobile activity and be rewarded for its lifetime value.

In-App Tracking

Native apps are tailor-made to the consumer's device platform and can give the best user experience and highest conversion rates. Tradedoubler's In-App Tracking (IAT) allows you to send users straight to a previously installed app and get rewarded for activity that takes place. That means increased mobile earnings!

You can now incorporate your apps within your performance marketing activities.

Deep Linking

If a user can search for specific products, results, etc. within your app you may want to send them to that specific area of the advertiser's app. Tradedoubler's SDK supports a standard deep link format allowing you to define where the user ends up in the advertiser's app. This prevents the user having to search again, provides a better user experience and increases conversion rates.

Offline Tracking

In-app actions may take place when the device does not have an internet connection (e.g. underground transport or during a flight). When this happens Tradedoubler's SDK will store the action data locally. When the app is next launched the SDK will check for any stored actions and send them to Tradedoubler. This way you can be certain that all actions will be tracked.

Implementation

This section explains how to implement Tradedoubler's tracking functionaltiy in your publisher app for the iOS and Android platforms.

Device ID tracking

The device ID is an indentifier unique to each device - iOS devices use the IDFA and Android devices use the Google Advertising ID. These IDs remain static unless the device is restored to factory settings and can therefore be used as an accurate tracking ID.

Device IDs are available for the publisher to collect at the time of click and the advertiser at time of download/conversion. This means there is no need to pass tracking data between the publisher and advertiser.

Your app must read the device ID and add it to the Tradedoubler click tag like this:

http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)
On Android devices the Google Advertising ID can be collected with this code:
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;
:
:
Info adInfo = null;
try {
	adInfo = AdvertisingIdClient.getAdvertisingIdInfo(mContext);
} catch (IOException e) {
	...
} catch (GooglePlayServicesAvailabilityException e) {
	...
} catch (GooglePlayServicesNotAvailableException e) {
	...
}
String AdId = adInfo.getId();
:
On iOS devices the IDFA is accessed via the advertisingIdentifier property in the ASIdentifierManager class. It can be collected with this code:
-[[ASIdentifierManager sharedManager] advertisingIdentifier];
When the user clicks the link the device ID will be stored by Tradedoubler and used when matching the click with app download or in-app activity.


How it Works




  1. On the click in the publisher app the DeviceID parameter is added to the Tradedoubler click tag and passed to Tradedoubler.
  2. The user is directed to the app (if already installed) or App Store/Google Play (if the app is not installed) with no tracking data. See the Redirect to App section for details of how to check if an app is already installed.
  3. When the user completes an in-app conversion the advertiser adds the DeviceID parameter to the trackback and it is passed to Tradedoubler.
  4. Tradedoubler validates the conversion by matching the device ID used in the click and in the trackback.

Note: No personal information or data is collected when using device ID tracking. The ID is anonymous and does not enable Tradedoubler to identify a person.

Limit ad tracking

Limit Ad Tracking is an iOS-specific function (iOS6 onwards) that enables users to highlight that they do not wish to receive targeted advertising. Apple states that if the user has turned Limit Ad Tracking on that you should "use the advertising identifier only for the following purposes: frequency capping, conversion events, estimating the number of unique users, security and fraud detection, and debugging".

You can check the Limit Ad Tracking setting by accessing the advertisingTrackingEnabled property in the ASIdentifierManager class.

The parameter is set to 'Yes' by default but you must check it's status and include it in the Tradedoubler click tag. If it is set to 'Yes' the click tag will look like this:

http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)limitAdTracking(off)
If the parameter is set to 'No' then the click tag should look like this:
http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)limitAdTracking(on)

Note: The inverse expression is used in the click tag. So if advertisingTrackingEnabled=Yes then limitAdTracking=off because the user has allowed advertising tracking.

The limitAdTracking parameter should always be included in the click tag for iOS devices. If limitAdTracking is set to 'on' conversion tracking will still work but no ad targeting can take place.

Redirect to app

IAT allows you to direct a user straight to an advertiser's app if it is already installed. For web-to-app user journeys Tradedoubler will handle this process but when sending user's to another app from within your own app you need to control this process. The steps below show how this is done.

iOS

  • Check to see if the app is already installed on the user's device using the canOpenURL method in the UIApplication class.
  • If the app is installed on the device the canOpenURL method will return a value of 'YES'. Then you should:
    1. Add the device ID to the click tag. See the Device ID Tracking section for details.
    2. Open the click tag in the background from the app.
    3. Open the advertiser app using the app's custom URL scheme (e.g. spotify://).
    4. Leads and sales made in the advertiser's app will be tracked using the device ID.
  • If the app is not installed on the device the canOpenURL method will return a value of 'NO'. Then you should:
    1. Open the click tag in the browser and drive the user to the advertiser's website instead of the app. Leads and sales will be tracked using the standard Tradedoubler methods.

The following code is an example of how this could be achieved:

NSURL *appURL = [NSURL URLWithString:@"myapp://"];
if ([[UIApplication sharedApplication] canOpenURL:appURL]) {
    [[UIApplication sharedApplication] openURL:appURL];
} else {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)limitAdTracking(off)"]];
}

Android

  • Check to see if the app is already installed on the user's device.
  • If the app is installed on the device then:
    1. Add the device ID to the click tag. See the Device ID Tracking section for details.
    2. Open the click tag in the background from the app.
    3. Open the advertiser app using an implicit intent.
    4. Leads and sales made in the advertiser's app will be tracked using the device ID.
  • If the app is not installed on the device then:
    1. Open the click tag in the browser and drive the user to the advertiser's website instead of the app. Leads and sales will be tracked using the standard Tradedoubler methods.

The following code is an example of how this could be achieved:

public class Example extends Activity
{
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		//Put the package name here
		boolean installed = appInstalledOrNot("com.Ch.Example.pack");
		if(installed) {
		Intent LaunchIntent = getPackageManager()
			.getLaunchIntentForPackage("com.Ch.Example.pack");
		startActivity(LaunchIntent);
		}
		else {
			Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)limitAdTracking(off)"));
			startActivity(browserIntent);
		}
	}

	private boolean appInstalledOrNot(String uri) {
		PackageManager pm = getPackageManager();
		boolean app_installed = false;
		try {
			   pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
			   app_installed = true;
		}
		catch (PackageManager.NameNotFoundException e) {
			   app_installed = false;
		}
		return app_installed ;
	}
}

Deep linking

You should follow the instructions in the Redirect to app section and add the location within the url parameter like this:

http://clk.tradedoubler.com/click?p(PROGRAM_ID)a(AFFILIATE_ID)g(AD_ID)deviceid(DEVICE_ID)url(DEEPLINK_URL)

Tradedoubler will collect the contents of the url parameter and add it to the deeplink parameter on the forwarding URL.