For apps, you install Trackingplan’s iOS SDK, Android SDK or both. Replace
YOUR_TP_IDwith your Trackingplan ID, which your install page shows.
This page uses the latest versions at the time of writing: 2.1.1 for iOS, and 3.1.1 for Android with its Gradle plugin at 2.2.0. Check for newer ones in our official repositories:
Trackingplan only sees the tracking your app sends after it starts, so start it before the SDK of any destination (Firebase, Adjust and the rest).
iOS SDK
The iOS SDK requires iOS 14 or later.
Installing Trackingplan’s iOS SDK using Swift Package Manager
With Trackingplan for iOS, you can check your tracking works as planned without changing your analytics stack or your code. Trackingplan monitors the traffic between your app and your data destinations and sends you warnings when something changes or breaks in your analytics, such as hit drops, missing properties, rogue events and more.
The recommended way to install Trackingplan for iOS is Swift Package Manager: it makes installing and upgrading Trackingplan simpler. Follow these steps.
- In Xcode, add the Trackingplan dependency with File → Add Package Dependencies... (File → Swift Packages → Add Package Dependency... in older versions of Xcode)

- If you’re asked to choose a project, select the project you want to add Trackingplan to. If not, proceed to step 3.

- When choosing a package repository, copy and paste
https://github.com/trackingplan/trackingplan-iosinto the search box and click Next.
- Choose
Versionand keep the default, the latest version (2.1.1 or later).
- Check the box next to Trackingplan and click Finish.

- Verify that the Trackingplan library has been added to the Swift Package Dependencies section.

- In your application delegate, import the SDK and start it at the beginning of
application(_:didFinishLaunchingWithOptions:), before the SDK of any destination:
// AppDelegate.swift
import Trackingplan
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Trackingplan.initialize(tpId: "YOUR_TP_ID")
// ... the rest of your setup, after Trackingplan
return true
}
All set. You have installed the Trackingplan iOS SDK. Now check that Trackingplan is collecting data correctly, so you know it is monitoring and documenting all the customer data you use for analytics, marketing and sales.
Installing iOS SDK with CocoaPods
Trackingplan also supports iOS installation using CocoaPods. Here is how.
- Add the Trackingplan dependency to your
Podfile, then runpod install:
pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git', :tag => '2.1.1'
- Import the SDK and start it in
application(_:didFinishLaunchingWithOptions:), exactly as with Swift Package Manager.
That’s it. Now check that Trackingplan is collecting data correctly.
Installing iOS SDK in a Flutter project
You can manage the Trackingplan iOS dependency with CocoaPods.
Your Flutter project is not using CocoaPods yet?
- Move to the iOS folder inside your Flutter project folder.
{project_name}/ios/ - Initialize CocoaPods:
$ pod init: this will create thePodfile.
Install:
- Open the
Podfile, uncomment theplatformline at the top and set it to iOS 14 or later:platform :ios, '14.0' - Add a line for the Trackingplan pod inside the target block:
pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git', :tag => '2.1.1'
- Make sure that
use_frameworks!is in place.
Sample Podfile (Project without CocoaPods):
platform :ios, '14.0'
...
target 'Runner' do
use_frameworks!
# Pods for Runner
pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git', :tag => '2.1.1'
end- Move to the ios folder path
{project_name}/ios/and run the command$ pod install
Sample Podfile (Project already using CocoaPods):
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git', :tag => '2.1.1'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
endSetup:
- Include Pods files in debug and release config:
- Edit the file
{project_name}/ios/Flutter/Debug.xcconfigand add at the end:#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" - Edit the file
{project_name}/ios/Flutter/Release.xcconfigand add at the end:#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"
- Edit the file
- Update
AppDelegate.swiftin{project_name}/ios/Runner/: addimport Trackingplanat the top, and callTrackingplan.initialize(tpId: "YOUR_TP_ID")at the beginning ofdidFinishLaunchingWithOptions.
Installing Trackingplan in Ionic for iOS platform
To use Trackingplan in an Ionic app, you set it up on each platform. It works much like installing Trackingplan in any mobile app.
Once that's done, Trackingplan captures and monitors every tracking request from any version of the app.
These instructions are for Capacitor Ionic apps, but they capture data from any analytics and marketing SDK, whether it is Capacitor, Cordova or JS. For Cordova apps without Capacitor, the installation is very similar.
- Open the Podfile and set the platform at the top to iOS 14 or later.
- Add the following lines for the Trackingplan pod inside the target block:
use_frameworks! use_modular_headers! pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git', :tag => '2.1.1' - Move to the
ios/Appfolder and run:pod install - Update AppDelegate.swift in
ios/App/Appto import Trackingplan at the top:import Trackingplan - Start Trackingplan with your Trackingplan ID at the beginning of the
didFinishLaunchingWithOptionsfunction:Trackingplan.initialize(tpId: "YOUR_TP_ID") - Run the following commands:
ionic build
npx cap sync ios
npx cap run iosInstalling Trackingplan in Ionic for web apps
You need this step if your analytics and marketing use JS SDKs instead of native ones (Cordova, Capacitor), or if you publish your app as a website.
- Add the Trackingplan snippet to your app's index.html.
- You'll find the snippet on the Head tab of your install page. See the instructions here.
iOS advanced options
Trackingplan.initialize takes these optional parameters, by name. Swift requires them in this order: leave out the ones you don't need, but don't reorder the rest.
| Parameter | Description | Default |
|---|---|---|
environment | Isolates the data of production and testing environments. | "PRODUCTION" |
tags | Tags for the data sent to Trackingplan, as a [String: String] dictionary of tag names and values. | [:] |
sourceAlias | Tells your sources apart. | "ios" |
customDomains | Extends the list of monitored domains, as a [String: String] dictionary of domains and parser IDs. See custom domains. | [:] |
debug | Prints debug information in the console. | false |
dryRun | Sends nothing to Trackingplan, so you can test the SDK. Requires debug: true, or the SDK does not start. | false |
trackingplanEndpoint | Where Trackingplan sends your data. Set it only if your plan is not in the EU datacenter: contact us for its value. | EU datacenter |
For example:
Trackingplan.initialize(
tpId: "YOUR_TP_ID",
environment: "development",
tags: ["country": "us"],
sourceAlias: "iOS app"
)
To change tags after Trackingplan has started, for example when the user changes country, call Trackingplan.updateTags(["country": "uk"]). New values replace the old ones for the same tag.
Automatic tagging. For iOS and Android SDKs, the
app_versiontag is included automatically, with no extra setup. Add any other tag, such ascountry,build numberortest name, with thetagsoption.
Using Custom domains
Trackingplan recognizes requests sent to the standard collection domains of the analytics and marketing platforms it supports, automatically. Each domain maps to a Trackingplan parser, which turns the raw requests into the enriched event format you see across the platform.
If your implementation sends data to a custom collection domain instead of the platform's default one, Trackingplan can't identify it automatically. In that case, configure the custom domain when you install Trackingplan.
To configure a custom domain, you need:
- The custom domain that your implementation sends requests to (for example, your own collection domain instead of the platform's default endpoint).
- The parser ID that tells Trackingplan which platform those requests belong to.
The parser value is not the name you'll see in Trackingplan. It is the internal identifier that tells Trackingplan how to read requests from that domain.
Some common parser IDs include:
Platform | Parser ID |
|---|---|
Server-side Google Tag Manager |
|
Stape |
|
Tealium |
|
Adobe Analytics |
|
Adobe Target |
|
Jentis |
|
Piano |
|
Android SDK
The Android SDK requires minSdk 24 (Android 7.0) or later and Android Gradle Plugin 8.0.2 or later.
Installing Trackingplan’s Android SDK using Gradle
With Trackingplan for Android, you can check your tracking works as planned without changing your analytics stack or your code.
- In Android Studio, expand the
Gradle Scriptssection.

- In the project-level
build.gradle.kts, add the Trackingplan plugin to thepluginsblock:
plugins {
// ...
id("com.trackingplan.client") version "2.2.0" apply false
}
- In the module-level
build.gradle.ktsof your app, apply the plugin and add the SDK:
plugins {
// ...
id("com.trackingplan.client")
}
dependencies {
// ...
implementation("com.trackingplan.client:sdk:3.1.1")
}
With Groovy (build.gradle), the lines are the same with Groovy syntax: id 'com.trackingplan.client' version '2.2.0' apply false in the project-level plugins, and id 'com.trackingplan.client' in the module-level plugins with implementation 'com.trackingplan.client:sdk:3.1.1' in its dependencies.
If your project still uses the legacy buildscript block, add classpath 'com.trackingplan.client:adapter:2.2.0' to its dependencies (with mavenCentral() among its repositories), and apply plugin: 'com.trackingplan.client' at the top of the module-level build.gradle.
- Start Trackingplan at the beginning of the
onCreate()method of yourApplicationclass, before the SDK of any destination:
import android.app.Application;
import com.trackingplan.client.sdk.Trackingplan;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Trackingplan.init("YOUR_TP_ID").start(this);
// ... the rest of your setup, after Trackingplan
}
}
If your app already has an Application class (the one android:name names on the <application> element of your AndroidManifest.xml), add the line to its onCreate(). If it has none, create one as above and register it in AndroidManifest.xml with <application android:name=".MyApplication" …>; Android does not run its onCreate() otherwise. Or start Trackingplan in the onCreate() of your main activity instead: it then misses whatever your app sends before that activity starts.
All set. Now check that Trackingplan is collecting data correctly.
You can also build Trackingplan for Android from the source code. To learn how, see our GitHub documentation.
Installing Android SDK in a Flutter project
Open the android directory inside your Flutter project, then:
- In
android/build.gradle(orandroid/settings.gradle, depending on your Flutter version), add the Trackingplan plugin as in step 2 above. With a legacybuildscriptblock, addclasspath "com.trackingplan.client:adapter:2.2.0"to its dependencies. - In
android/app/build.gradle, apply the plugin (id 'com.trackingplan.client'inplugins, orapply plugin: 'com.trackingplan.client') and addimplementation 'com.trackingplan.client:sdk:3.1.1'to its dependencies. - Make sure
minSdkis 24 or higher.
Finally, start Trackingplan in the onCreate() method of your Application class or, if your app has none, of MainActivity (android/app/src/main/kotlin):
import com.trackingplan.client.sdk.Trackingplan
Trackingplan.init("YOUR_TP_ID").start(this)
Installing Trackingplan in Ionic for Android platform
- Add the Trackingplan classpath dependency to the project-level
android/build.gradle(the one at the root of theandroidfolder, not the one insideandroid/app):classpath "com.trackingplan.client:adapter:2.2.0" - Open the module-level Gradle file,
android/app/build.gradle. In the dependencies block, add:implementation 'com.trackingplan.client:sdk:3.1.1' - At the top level of that file, add:
apply plugin: 'com.trackingplan.client' - Start Trackingplan in your MainActivity.java file, located at
android/app/src/main/java/MainActivity.java. Add anonCreatemethod inside theMainActivityclass and start Trackingplan with your Trackingplan ID:import com.getcapacitor.BridgeActivity; import android.os.Bundle; import com.trackingplan.client.sdk.Trackingplan; public class MainActivity extends BridgeActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Start Trackingplan with your Trackingplan ID Trackingplan.init("YOUR_TP_ID").start(this); } } - Set
minSdkVersion = 24or higher inandroid/variables.gradle. - Run the commands:
ionic build npx cap sync android npx cap run android
Android advanced options
Trackingplan.init("YOUR_TP_ID") returns a builder that takes these options before .start(this):
| Option | Description | Default |
|---|---|---|
environment(value) | Isolates the data of production and testing environments. | PRODUCTION |
sourceAlias(value) | Tells your sources apart. | android |
tags(map) | Tags for the data sent to Trackingplan, as a map of tag names and values. | empty map |
customDomains(map) | Extends the list of monitored domains, as a map of domains and parser IDs. See custom domains. | empty map |
enableDebug() | Prints debug information in the console. | disabled |
dryRun() | Sends nothing to Trackingplan, so you can test the SDK. Requires enableDebug(): without it, start() throws an error. | disabled |
tracksEndPoint(value) | Where Trackingplan sends your data. Set it only if your plan is not in the EU datacenter: contact us for its value. | EU datacenter |
For example:
Trackingplan.init("YOUR_TP_ID")
.environment("development")
.sourceAlias("Android app")
// .tags(new HashMap<>(){{
// put("tag1", "value1");
// }})
// .customDomains(new HashMap<>(){{
// put("my.domain.com", "ssgtm");
// }})
// .enableDebug()
// .dryRun()
.start(this);
To change tags after Trackingplan has started, call Trackingplan.updateTags(newTags) with a map of the tags to add or replace.
Questions or problems along the way? Contact support.