Documentation

Developers

API References
Data Subject Request API

Data Subject Request API Version 1 and 2

Data Subject Request API Version 3

Platform API

Platform API Overview

Accounts

Apps

Audiences

Calculated Attributes

Data Points

Feeds

Field Transformations

Services

Users

Workspaces

Warehouse Sync API

Warehouse Sync API Overview

Warehouse Sync API Tutorial

Warehouse Sync API Reference

Data Mapping

Warehouse Sync SQL Reference

Warehouse Sync Troubleshooting Guide

ComposeID

Warehouse Sync API v2 Migration

Bulk Profile Deletion API Reference

Calculated Attributes Seeding API

Custom Access Roles API

Data Planning API

Group Identity API Reference

Pixel Service

Profile API

Events API

mParticle JSON Schema Reference

IDSync

Client SDKs
AMP

AMP SDK

Android

Initialization

Configuration

Network Security Configuration

Event Tracking

User Attributes

IDSync

Screen Events

Commerce Events

Location Tracking

Media

Kits

Application State and Session Management

Data Privacy Controls

Error Tracking

Opt Out

Push Notifications

WebView Integration

Logger

Preventing Blocked HTTP Traffic with CNAME

Linting Data Plans

Troubleshooting the Android SDK

API Reference

Upgrade to Version 5

Cordova

Cordova Plugin

Identity

Direct Url Routing

Direct URL Routing FAQ

Web

Android

iOS

Flutter

Getting Started

Usage

API Reference

React Native

Getting Started

Identity

Roku

Getting Started

Identity

Media

iOS

Initialization

Configuration

Event Tracking

User Attributes

IDSync

Screen Tracking

Commerce Events

Location Tracking

Media

Kits

Application State and Session Management

Data Privacy Controls

Error Tracking

Opt Out

Push Notifications

Webview Integration

Upload Frequency

App Extensions

Preventing Blocked HTTP Traffic with CNAME

Linting Data Plans

Troubleshooting iOS SDK

Social Networks

iOS 14 Guide

iOS 15 FAQ

iOS 16 FAQ

iOS 17 FAQ

iOS 18 FAQ

API Reference

Upgrade to Version 7

Xbox

Getting Started

Identity

Unity

Upload Frequency

Getting Started

Opt Out

Initialize the SDK

Event Tracking

Commerce Tracking

Error Tracking

Screen Tracking

Identity

Location Tracking

Session Management

Web

Initialization

Content Security Policy

Configuration

Event Tracking

User Attributes

IDSync

Page View Tracking

Commerce Events

Location Tracking

Media

Kits

Application State and Session Management

Data Privacy Controls

Error Tracking

Opt Out

Custom Logger

Persistence

Native Web Views

Self-Hosting

Multiple Instances

Web SDK via Google Tag Manager

Preventing Blocked HTTP Traffic with CNAME

Facebook Instant Articles

Troubleshooting the Web SDK

Browser Compatibility

Linting Data Plans

API Reference

Upgrade to Version 2 of the SDK

Xamarin

Getting Started

Identity

Web

Alexa

Server SDKs

Node SDK

Go SDK

Python SDK

Ruby SDK

Java SDK

Tools

mParticle Command Line Interface

Linting Tools

Smartype

Media SDKs

Android

Web

iOS

Quickstart
Android

Overview

Step 1. Create an input

Step 2. Verify your input

Step 3. Set up your output

Step 4. Create a connection

Step 5. Verify your connection

Step 6. Track events

Step 7. Track user data

Step 8. Create a data plan

Step 9. Test your local app

HTTP Quick Start

Step 1. Create an input

Step 2. Create an output

Step 3. Verify output

iOS Quick Start

Overview

Step 1. Create an input

Step 2. Verify your input

Step 3. Set up your output

Step 4. Create a connection

Step 5. Verify your connection

Step 6. Track events

Step 7. Track user data

Step 8. Create a data plan

Java Quick Start

Step 1. Create an input

Step 2. Create an output

Step 3. Verify output

Node Quick Start

Step 1. Create an input

Step 2. Create an output

Step 3. Verify output

Python Quick Start

Step 1. Create an input

Step 2. Create an output

Step 3. Verify output

Web

Overview

Step 1. Create an input

Step 2. Verify your input

Step 3. Set up your output

Step 4. Create a connection

Step 5. Verify your connection

Step 6. Track events

Step 7. Track user data

Step 8. Create a data plan

Guides
Partners

Introduction

Outbound Integrations

Outbound Integrations

Firehose Java SDK

Inbound Integrations

Kit Integrations

Overview

Android Kit Integration

JavaScript Kit Integration

iOS Kit Integration

Data Hosting Locations

Compose ID

Glossary

Migrate from Segment to mParticle

Migrate from Segment to mParticle

Migrate from Segment to Client-side mParticle

Migrate from Segment to Server-side mParticle

Segment-to-mParticle Migration Reference

Rules Developer Guide

API Credential Management

The Developer's Guided Journey to mParticle

Guides

Getting Started

Create an Input

Start capturing data

Connect an Event Output

Create an Audience

Connect an Audience Output

Transform and Enhance Your Data

Platform Guide
The New mParticle Experience

The new mParticle Experience

The Overview Map

Observability

Observability Overview

Observability User Guide

Observability Span Glossary

Introduction

Data Retention

Connections

Activity

Live Stream

Data Filter

Rules

Tiered Events

mParticle Users and Roles

Analytics Free Trial

Troubleshooting mParticle

Usage metering for value-based pricing (VBP)

Analytics

Introduction

Setup

Sync and Activate Analytics User Segments in mParticle

User Segment Activation

Welcome Page Announcements

Settings

Project Settings

Roles and Teammates

Organization Settings

Global Project Filters

Portfolio Analytics

Analytics Data Manager

Analytics Data Manager Overview

Events

Event Properties

User Properties

Revenue Mapping

Export Data

UTM Guide

Query Builder

Data Dictionary

Query Builder Overview

Modify Filters With And/Or Clauses

Query-time Sampling

Query Notes

Filter Where Clauses

Event vs. User Properties

Group By Clauses

Annotations

Cross-tool Compatibility

Apply All for Filter Where Clauses

Date Range and Time Settings Overview

Understanding the Screen View Event

Analyses

Analyses Introduction

Segmentation: Basics

Getting Started

Visualization Options

For Clauses

Date Range and Time Settings

Calculator

Numerical Settings

Segmentation: Advanced

Assisted Analysis

Properties Explorer

Frequency in Segmentation

Trends in Segmentation

Did [not] Perform Clauses

Cumulative vs. Non-Cumulative Analysis in Segmentation

Total Count of vs. Users Who Performed

Save Your Segmentation Analysis

Export Results in Segmentation

Explore Users from Segmentation

Funnels: Basics

Getting Started with Funnels

Group By Settings

Conversion Window

Tracking Properties

Date Range and Time Settings

Visualization Options

Interpreting a Funnel Analysis

Funnels: Advanced

Group By

Filters

Conversion over Time

Conversion Order

Trends

Funnel Direction

Multi-path Funnels

Analyze as Cohort from Funnel

Save a Funnel Analysis

Explore Users from a Funnel

Export Results from a Funnel

Cohorts

Getting Started with Cohorts

Analysis Modes

Save a Cohort Analysis

Export Results

Explore Users

Saved Analyses

Manage Analyses in Dashboards

Journeys

Getting Started

Event Menu

Visualization

Ending Event

Save a Journey Analysis

Users

Getting Started

User Activity Timelines

Time Settings

Export Results

Save A User Analysis

Dashboards

Dashboards––Getting Started

Manage Dashboards

Organize Dashboards

Dashboard Filters

Scheduled Reports

Favorites

Time and Interval Settings in Dashboards

Query Notes in Dashboards

User Aliasing

Analytics Resources

The Demo Environment

Keyboard Shortcuts

Tutorials

Analytics for Marketers

Analytics for Product Managers

Compare Conversion Across Acquisition Sources

Analyze Product Feature Usage

Identify Points of User Friction

Time-based Subscription Analysis

Dashboard Tips and Tricks

Understand Product Stickiness

Optimize User Flow with A/B Testing

User Segments

APIs

User Segments Export API

Dashboard Filter API

IDSync

IDSync Overview

Use Cases for IDSync

Components of IDSync

Store and Organize User Data

Identify Users

Default IDSync Configuration

Profile Conversion Strategy

Profile Link Strategy

Profile Isolation Strategy

Best Match Strategy

Aliasing

Data Master
Group Identity

Overview

Create and Manage Group Definitions

Introduction

Catalog

Live Stream

Data Plans

Data Plans

Blocked Data Backfill Guide

Personalization
Predictive Attributes

Predictive Attributes Overview

Create Predictive Attributes

Assess and Troubleshoot Predictions

Use Predictive Attributes in Campaigns

Predictive Audiences

Predictive Audiences Overview

Using Predictive Audiences

Introduction

Profiles

Calculated Attributes

Calculated Attributes Overview

Using Calculated Attributes

Create with AI Assistance

Calculated Attributes Reference

Audiences

Audiences Overview

Real-time Audiences

Standard Audiences

Journeys

Journeys Overview

Manage Journeys

Download an audience from a journey

Audience A/B testing from a journey

Journeys 2.0

Warehouse Sync

Data Privacy Controls

Data Subject Requests

Default Service Limits

Feeds

Cross-Account Audience Sharing

Approved Sub-Processors

Import Data with CSV Files

Import Data with CSV Files

CSV File Reference

Glossary

Video Index

Analytics (Deprecated)
Identity Providers

Single Sign-On (SSO)

Setup Examples

Settings

Debug Console

Data Warehouse Delay Alerting

Introduction

Developer Docs

Introduction

Integrations

Introduction

Rudderstack

Google Tag Manager

Segment

Data Warehouses and Data Lakes

Advanced Data Warehouse Settings

AWS Kinesis (Snowplow)

AWS Redshift (Define Your Own Schema)

AWS S3 Integration (Define Your Own Schema)

AWS S3 (Snowplow Schema)

BigQuery (Snowplow Schema)

BigQuery Firebase Schema

BigQuery (Define Your Own Schema)

GCP BigQuery Export

Snowflake (Snowplow Schema)

Snowplow Schema Overview

Snowflake (Define Your Own Schema)

APIs

Dashboard Filter API (Deprecated)

REST API

User Segments Export API (Deprecated)

SDKs

SDKs Introduction

React Native

iOS

Android

Java

JavaScript

Python

Object API

Developer Basics

Aliasing

Kits

In most cases, data collected by the mParticle SDK is sent to mParticle, and then forwarded on to integration partners server-to-server.

However, in cases where a server-to-server integration cannot support all the required functionality of an integration partner, an embedded kit may be used. Embedded kits are extra components added to the mParticle SDK that communicate directly with an integration partner from the app client. Usually the embedded kit includes some or all of the partner’s own client-side SDK.

mParticle supports several kinds of client-side kits:

  • mParticle-hosted kits that mParticle has developed and fully supports.
  • Partner-hosted kits that have been tested and are fully supported by mParticle:

  • Sideloaded kits, also called custom kits, that have not been tested and are not support by mParticle. You are responsible for any sideloaded kit that you write yourself or include from a third-party source. This responsibility includes the correct handling and protection of user profiles and identities both within your own system as well as any third-party service you may forward that data to. Be especially cautious with sideloaded kits you may find from third-party repositories. They will potentially receive all events that you log via the mParticle SDK, so you are responsible for ensuring that they handle that data correctly and safely.

Just as with other integrations, you are not required to write any client-side code to leverage the kits. As with other integrations, you should enable and configure the mParticle-hosted kits listed below via the mParticle Dashboard.

Refer to the iOS and Android SDK GitHub repositories for configuring these kits with the mParticle SDK into your app.

Adding the Kit dependency

The Core SDK will detect kits at runtime, but you need to add them as dependencies to your build:

dependencies {
    implementation (
        'com.mparticle:android-example-kit:5+',
        'com.mparticle:android-another-kit:5+',
    )
}

Kits are deployed as individual artifacts in Maven Central, and each has a dedicated repository if you’d like to view the source code.

To find the artifact for a kit in Maven Central, go to Maven Central and search for a partner integration including the keyword “mparticle”.

To find a kit’s repository, go to mparticle-integrations and search for a partner integration. Some partners have integrations for multiple platform SDKs, so make sure to select the correct integration for the SDK you are using. Most kit repository names follow the pattern mparticle-PLATFORM-integration-PARTNER.

Making direct calls to Kits

The mParticle SDK only initializes kits that are enabled for your app in the mParticle dashboard. Since services can be enabled or disabled at any time, it is important to confirm that a kit has been initialized in your app before trying to access its APIs. mParticle provides a simple method to ensure that a kit is active. You can then access the kit instance directly and call any APIs you need.

private void refreshFeed {
    if (MParticle.getInstance().isKitActive(ServiceProviders.APPBOY)) {
        //Active kit code
    }
}
fun refreshFeed() {
    if (MParticle.getInstance()?.isKitActive(ServiceProviders.APPBOY) ?: false) {
        //Active kit code
    }
}

Kit Availability and Unavailability Notifications

The mParticle SDK also allows you to listen for kit activity notifications asynchronously, avoiding the need to repeatedly check if a kit is active or inactive.

//Use the BROADCAST_ACTIVE and BROADCAST_DISABLED actions, concatenated with the provider ID
IntentFilter filter = new IntentFilter(MParticle.ServiceProviders.BROADCAST_ACTIVE + MParticle.ServiceProviders.APPBOY);
filter.addAction(MParticle.ServiceProviders.BROADCAST_DISABLED + MParticle.ServiceProviders.APPBOY);
this.registerReceiver(new BroadcastReceiver() {
  @Override
  public void onReceive(Context context, Intent intent) {

     if (intent.getAction().startsWith(MParticle.ServiceProviders.BROADCAST_ACTIVE)){
       //make a direct Appboy API call, or set a boolean field that you can check elsewhere
     }else{
       //the provider has been deactivated, avoid future calls to it
     }
  }
}, filter);
//Use the BROADCAST_ACTIVE and BROADCAST_DISABLED actions, concatenated with the provider ID
var filter = IntentFilter(MParticle.ServiceProviders.BROADCAST_ACTIVE + MParticle.ServiceProviders.APPBOY);
filter.addAction(MParticle.ServiceProviders.BROADCAST_DISABLED + MParticle.ServiceProviders.APPBOY);
this.registerReceiver(object : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action!!.startsWith(MParticle.ServiceProviders.BROADCAST_ACTIVE)) {
            //make a direct Appboy API call, or set a boolean field that you can check elsewhere
        } else {
            //the provider has been deactivated, avoid future calls to it
        }
    }
}, filter);

Deep Linking

Several integrations support the creation and attribution of deep links to install and open an app. A deep link will typically contain some additional information to be used when the user ultimately opens your application, so that you can properly route the user to the appropriate content, or otherwise customize their experience.

As at version 5, the mParticle SDKs offer an integration-agnostic Attribution Listener API that lets you query your integrations at runtime to determine if the given user arrived by way of a deep link.

The following integrations support deep linking:

public class SampleApplication extends Application implements AttributionListener {

    @Override
    public void onCreate() {
        super.onCreate();
        MParticleOptions options = MParticleOptions.builder(this)
                .credentials("FOO", "BAR")
                .attributionListener(this)
                .logLevel(MParticle.LogLevel.VERBOSE)
                .build();
        MParticle.start(options);
    }

    @Override
    public void onResult(AttributionResult attributionResult) {
        //do something with attributionResult
    }

    @Override
    public void onError(AttributionError attributionError) {
        //do something with attributionError
    }
}
class SampleApplication : Application(), AttributionListener {

    override fun onCreate() {
        super.onCreate();
        MParticleOptions.builder(this).run {
            credentials("FOO", "BAR")
            attributionListener(this@SampleApplication)
            logLevel(MParticle.LogLevel.VERBOSE)
            build()
        }.also {
            MParticle.start(it);
        }
    }

    override fun onResult(attributionResult: AttributionResult) {
        //do something with attributionResult
    }

    override fun onError(attributionError: AttributionError) {
        //do something with attributionError
    }
}

Determining Which Partner SDK Version is Being Used By a Kit

The types of questions most users have about kits are:

  • What version of the partner SDK do you “support”?
  • Which version of a partner’s SDK does a given app/SDK version “use”?

These are two different questions. mParticle defines “support” as - if you can build an app/site with the mParticle SDK and the app compiles, it’s supported.

Therefore, we do not manually test every single version of every single kit.

We only verify that they compile. If the partner breaks their SDK, or our integration with it, it’s possible that we will not know it.

If a partner breaks their SDK/our integration, it typically means they’ve also broken anyone who is directly integrating.

For the Android SDK, which is different than iOS, we do not push individual tags for each kit repo, ever. Instead, each kit is a Git “submodule” of our core SDK. This means that for every commit, tag, and release of the Android SDK, we lock to a specific commit in the partner’s repository. We still do push a new maven artifact for each kit for each version of the SDK - you just won’t see tags in the kit repos.

Android also differs from iOS in that we never use wildcards for kit SDK dependencies. This is because the notion of a “lockfile” does not exist for Android’s Gradle (actually it does, but is not widely adopted). So, using wildcards can lead to unrepeatable builds for our customers.

Find the Kit Source Code

Given version x.y.z of a kit, to find the partner SDK version supported:

  1. Navigate to the “kits” directory of our Android SDK Github repo: https://github.com/mParticle/mparticle-android-sdk/tree/master/kits
  2. Using the dropdown at the top-left of the repository, select the “Tags” tab and then click on the tag version x.y.z that you are checking.
  3. Click on the kit that you are checking, this will link you out to the mParticle Integrations Github repository for that kit, at the specific commit hash that applies to the tag you chose in step (2).

Determine the Version

  1. Click to open the build.gradle file, and look for a line that refers to the partner’s SDK (example). In the linked example, the kit is using Airship SDK 9.7.1:
dependencies {
    api 'com.urbanairship.android:urbanairship-core:9.7.1'
    testImplementation 'junit:junit:4.12'
    testImplementation files('libs/java-json.jar')
    testImplementation "org.mockito:mockito-core:1.+"
}

Sideloaded Kits (Custom kits)

Kits are generally added and configured via the mParticle UI settings. When initializing the app, the mParticle SDK receives the configuration settings from our servers and initializes each kit. When you send events to the mParticle Android SDK, they are routed to each kit and mapped to a partner SDK method, ultimately arriving in our partners’ dashboards for your analysis. The kits in our UI are either built by mParticle or by partners. When partners build kits, we require careful coordination and updates to our database in order for their kits to work properly within our ecosystem.

However, there may be cases where you’d like to build a custom kit, whether to debug or to quickly send data to a partner SDK for which we do not have an official kit. We support the ability to build your own kit which can receive events without needing any configuration in our UI or database. We call these sideloaded kits. When sideloaded kits are included in your app, they remove the need for settings from our server because you configure the kit yourself and then include it using a public API we provide.

Important Safety Warning

Remember that while mParticle fully supports all official kits located in the “mparticle-integrations” GitHub organization as well as official kits created by our partners, you are responsible for any sideloaded kit you write yourself or include from a third-party source. This responsibility includes the correct handling and protection of user profiles and identities both within your own system as well as any third-party service you may forward that data to.

Be especially cautious with sideloaded kits you may find from third-party repositories. They will potentially receive all events that you log via the mParticle SDK, so you are responsible for ensuring that they handle that data correctly and safely.

Critical Limitations

Keep in mind that sideloaded kits are completely client-side, so things like data filtering are configured client-side and these options will not be available in the mParticle dashboard. This also means that event forwarding and filtering metrics from sideloaded kits will not be included in the metrics displayed in the mParticle dashboard as they would for official kits.

Our official support channels will be unable to help with issues you may have with your sideloaded kit such as data unavailable downstream, crashes, or unsupported functionality. mParticle support will only be able to help in cases where there is an issue with the mParticle SDK sideloaded kit feature in general.

Developing a Sideloaded Kit

On Android a sideloaded kit is essentially just a class that extends MPSideloadedKit. A simple example written in Kotlin can be found here and the KitIntegration and SideloadedKit definitions, which MPSideloadedKit extends from and implements can be found here and here respectively.

There are a few things to keep in mind when developing your kit:

  1. The class methods getName, onKitCreate and setOptOut can be implemented but are not mandatory. The onKitCreate function will be called in the kit lifecycle as any other mParticle kit, therefore you can override it with your specific business logic and return an empty list.
  2. Remember that, as with any other kits, the core sdk propagates some messages to the kits based on the listeners implemented by them, so please review if your sideloaded kit implementation is implementing the interfaces required. Each concrete sideloading kit implementation requires to pass a kitId (greater or equal than 1000000) to the superclass MPSideloadedKit constructor. If the kitId is lower than the specified value the kit won’t be included.
  3. To add filters to a sideloaded kit an MPSideloadedFilters object must be created using its builder, and added to the kit itself. Each MPSideloadedFilters object can have various filtering configurations and be used to setup multiple sideloaded kits.
public class LoggingCustomKit() extends MPSideloadedKit(1000001) { }

MPSideloadedFilters filters = new MPSideloadedFilters.Builder()
        .addScreenNameFilter("screen_name")
        .addCommerceEventAttributeFilter(MPSideloadedFilters.CommerceEventType.PRODUCT_EVENT_TYPE_CHECKOUT, "event_attribute_key")
        .addUserAttributeFilter("user_attribute_key")
        .build();

SideloadedKit kit = new LoggingCustomKit().addFilters(filters);
class LoggingCustomKit() : MPSideloadedKit(1000001) {}

val filters =  MPSideloadedFilters.Builder()
        .addScreenNameFilter("screen_name")
        .addCommerceEventAttributeFilter(MPSideloadedFilters.CommerceEventType.PRODUCT_EVENT_TYPE_CHECKOUT, "event_attribute_key")
        .addUserAttributeFilter("user_attribute_key")
        .build()

val kit = LoggingCustomKit(1000001).addFilters(filters)

Including the Sideloaded Kit

The sideloaded kit must be included directly in your application’s source code, on the initialization process.

To register the sideloaded kit, all that’s needed is to create an instance and pass it to the sideloadedKits property of the MParticleOptions object:

public class LoggingCustomKit() extends MPSideloadedKit(1000001) { }

SideloadedKit kit = new LoggingCustomKit();
List<SideloadedKit> kits = new ArrayList();
kits.add(kit);

MParticleOptions options = MParticleOptions.builder(this)
    .credentials("FOO", "BAR")
    .logLevel(MParticle.LogLevel.VERBOSE)
    .sideloadedKits(kits)
    .build();
MParticle.start(options);
class LoggingCustomKit() : MPSideloadedKit(1000001) {}

val kit : SideloadedKit = LoggingCustomKit()

val options: MParticleOptions = MParticleOptions.builder(this)
        .credentials("FOO", "BAR")
        .logLevel(MParticle.LogLevel.VERBOSE)
        .sideloadedKits(listOf(kit))
        .build()

MParticle.start(options)

Note that you may use multiple instances of the same sideloaded kit class, but each one must be initialized with a unique kitId. Each sideloaded kit does not need to be a unique class, only a unique instance.

Was this page helpful?

    Last Updated: December 5, 2024