mParticle is a customer data platform (CDP) that helps businesses collect, unify, and activate their customer data across various digital touchpoints. It provides a single API to collect data from websites, mobile apps, and other sources, and then allows businesses to connect this data to their marketing, analytics, and data warehousing tools.
mParticle is a customer data platform (CDP) that helps businesses collect, unify, and activate their customer data across various digital touchpoints. It provides a single API to collect data from websites, mobile apps, and other sources, and then allows businesses to connect this data to their marketing, analytics, and data warehousing tools.
The Singular SDK is available as a kit for mParticle. After you integrate the kit, mParticle will forward sessions from your app to Singular, triggering Singular's app install attribution process when relevant.
Optional features include forwarding in-app events, tracking revenue, support for SKAdNetwork (on iOS devices), and handling deep links and deferred deep links.
Guide for | Engineering Teams |
Prerequisites | This article assumes you already have the mParticle SDK integrated in your app. |
Steps for iOS Integration
1 |
Get your Singular SDK KeyIn your Singular account, go to "Developer Tools > SDK Integration > SDK Keys" and copy your SDK Key and Secret. |
2 |
Add Singular as an mParticle Output
|
3 |
Install the Singular SDKTo install the Singular SDK:
|
4 |
Import the Singular LibraryTo import the Singular library, add the following line of code:
|
5 |
Initialize the Singular SDKThe SDK initialization code should be called every time the app is opened. It is a prerequisite to all Singular attribution functionality, and it also sends a new user session to Singular (sessions are used to calculate user retention).
|
6 |
[OPTIONAL] Track EventsSingular can collect data about in-app events to help analyze the performance of your campaigns and measure KPIs. Depending on your application, you may want to track events such as user logins, registrations, tutorial completions, or leveling up in a game. The following sample code reports an event called "event_name" to Singular, with two custom attributes. You'll be able to see counts of "event_name" occurrences in your Singular reports.
|
7 |
[OPTIONAL] Track RevenueSingular can collect data about revenue gained through the app to help analyze the performance and ROI of your campaigns. Singular will make the data available to you in reports, log export, and postbacks. To track revenue, report revenue events to Singular as in the following example. This example reports an in-app purchase of a product, giving the product name, SKU, quantity, and price.
Note: Pass currency as a three-letter ISO 4217 currency code, e.g., "USD," "EUR", "INR". |
8 |
[OPTIONAL] Add SKAdNetwork SupportSKAdNetwork is Apple's new framework for determining mobile install attribution without compromising the end user's privacy. SKAdNetwork lets you measure the performance of your app marketing campaigns without sharing the user's personally identifiable information. Singular SKAdNetwork solution, SKAN, allows you to implement SKAdNetwork with minimal engineering effort. Once you initialize SKAN, every event you report to Singular is automatically processed on the server side to update the conversion value based on your predefined conversion model. The new conversion value is then sent back to the app. This process repeats itself until the measurement period is over and the app sends the latest conversion value to SKAdNetwork. For more information, see Introduction to Singular's SKAdNetwork Solution and How to Get Started with SKAdNetwork. The following sample code enables SKAN following a 60-second wait for ATT consent (see Singular iOS SDK: Handling AppTrackingTransparency Consent). Note: This code needs to run before mParticle is initialized.
|
9 |
[OPTIONAL] Handle Deep LinksDeep links are links that lead into specific content inside an app. When a user clicks a deep link on a device that has the app installed, the app opens and shows a specific product or experience. Singular tracking links can include deep linking as well as deferred deep linking (see our Deep Linking FAQ and the Singular Links FAQ for more information). Notes:
Handling Deep Links Using AppDelegate:Add a call to the SDK initialization method, including onAttributionComplete:
Also add a call mParticle's continueUserActivity method in AppDelegate's continueUserActivity:
Handling Deep Links Using SceneDelegate:Add a call to mParticle's continueUserActivity method in SceneDelegate's continueUserActivity and willConnectToSession:
|
Steps for Android Integration
1 |
Get your Singular SDK KeyIn your Singular account, go to "Developer Tools > SDK Integration > SDK Keys" and copy your SDK Key and Secret. |
2 |
Add Singular as an mParticle Output
|
3 |
Install the SDK
|
4 |
Initialize the SDKThe SDK initialization code should be called every time the app is opened. It is a prerequisite to all Singular attribution functionality, and it also sends a new user session to Singular (sessions are used to calculate user retention). You'll be able to track sessions in the mParticle dashboard as well as Singular reports.
|
5 |
[OPTIONAL] Set the User IDThe Singular SDK can send a user ID from your app to Singular. This can be a username, email address, randomly generated string, or whichever identifier you use as a user ID. Singular uses the user ID in user-level data exports and internal BI postbacks (if you configure such postbacks). Once you set the user ID, it is sent along with any session and event. The user ID persists until you unset it or until the app is uninstalled. Closing/restarting the app does not unset the user ID.
|
6 |
[OPTIONAL] Track EventsSingular can collect data about in-app events to help analyze the performance of your campaigns and measure KPIs. Depending on your application, you may want to track events such as user logins, registrations, tutorial completions, or leveling up in a game. The following sample code reports an event called "test_event" to Singular with additional information (customAttributes) in JSONObject format.
|
7 |
[OPTIONAL] Track RevenueSingular can collect data about revenue gained through the app by receiving Product.PURCHASE events from mParticle. Event revenue is calculated as quantity * product_cost.
Note: Pass currency as a three-letter ISO 4217 currency code, e.g., "USD," "EUR", "INR". |
8 |
[OPTIONAL] Handle Deep LinksDeep links are links that lead into specific content inside an app. When a user clicks a deep link on a device that has the app installed, the app opens and shows a specific product or experience. Singular tracking links can include deep linking as well as deferred deep linking (see our Deep Linking FAQ and the Singular Links FAQ for more information). Notes:
To handle deep links, implement AttributionListener as in the following example. Note that you need to implement AttributionListener in every main entrance activity.
|