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

Direct Url Routing

Direct URL Routing FAQ

Web

Android

iOS

Cordova

Cordova Plugin

Identity

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

Flutter

Getting Started

Usage

API Reference

React Native

Getting Started

Identity

Roku

Getting Started

Identity

Media

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

Xamarin

Getting Started

Identity

Web

Initialization

Configuration

Content Security Policy

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

Web

Alexa

Media SDKs

Android

iOS

Web

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

Server SDKs

Node SDK

Go SDK

Python SDK

Ruby SDK

Java SDK

Tools

Linting Tools

Smartype

mParticle Command Line Interface

Guides
Partners

Introduction

Outbound Integrations

Outbound Integrations

Firehose Java SDK

Inbound Integrations

Kit Integrations

Overview

Android Kit Integration

JavaScript Kit Integration

iOS Kit Integration

Compose ID

Data Hosting Locations

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

Users

Getting Started

User Activity Timelines

Time Settings

Export Results

Save A User Analysis

Journeys

Getting Started

Event Menu

Visualization

Ending Event

Save a Journey 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 Audiences

Predictive Audiences Overview

Using Predictive Audiences

Predictive Attributes

Predictive Attributes Overview

Create Predictive Attributes

Assess and Troubleshoot Predictions

Use Predictive Attributes in Campaigns

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)
Settings

Debug Console

Data Warehouse Delay Alerting

Identity Providers

Single Sign-On (SSO)

Setup Examples

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

Snowplow Schema Overview

Snowflake (Snowplow Schema)

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

Outbound Integrations

An Outbound Integration with mParticle can be set up via AWS Lambda or an HTTP endpoint, and you can integrate as an event and/or audience partner, depending on the features and functionality of your service.

You can provide mParticle with a different endpoint to be setup per Data Centers. This allows customers who are in the different Data Centers to send data to you with improved latency.

Below is a high level overview of the integration process:

  1. Develop and test

    • Download and review the mParticle SDK & sample code
    • Implement handlers for module registration and data processing
    • Test locally using sample JSON
  2. Build and deploy

    • For Lambda integrations, publish to your AWS Lambda account, provide mParticle your complete ARN, and grant mParticle execution access to your function
    • For HTTP integrations, provide mParticle with your endpoints for registration, event and/or audience
  3. Register and verification

    • mParticle registers your endpoint to get registration metadata
    • mParticle sets up event and/or audience configurations to your endpoint for testing
    • mParticle and partner verify the configuration and mParticle deploys the new integration for general customer use

The following resources provide a starting point for developing an outbound Firehose server-to-server integration with mParticle, using our Firehose Java SDK.

It is not necessary to use the Java SDK to build either a Lambda or HTTP integration, as long as you can respond to the following requests in the required format:

  • ModuleRegistrationRequest
  • EventProcessingRequest (Event integrations only)
  • AudienceSubscriptionRequest (Audience integrations only)
  • AudienceMembershipChangeRequest (Audience integrations only)

See the mParticle Firehose documentation for more information on these requests, and the JSON samples in the SDK repository for formatting. Use this Postman collection to easily test requests against your Lambda or HTTP endpoints.

Run in Postman

AWS Lambda Integrations

Leveraging Amazon AWS’s Lambda platform, mParticle will send your “lambda function” data as it comes into our system so that your function can then forward it along to your own API.

Two sample projects are available on GitHub to help you get started with your Lambda integration:

  • Sample Project can be cloned to get started on building your Lambda integration.
  • Iterable Extension is a real world event and audience integration built using the mParticle Java SDK. This can be used as a reference to see a full working example.
  • Javadocs contains the Javadocs for the different classes and methods available in the mParticle Java SDK.

Don’t forget to provide a high-resolution logo to mParticle in SVG format with a transparent background.

Tuning Tips

  1. Machine size - AWS uses the memory that you allocate to your function as a proxy for CPU allocation. A function with 128MB of memory will be allocated 2x more CPU than a function with 64MB of memory, a function with 256MB will be allocated 2x CPU of a 128MB function, etc. Most of the Lambda functions that we see actually use less than 100MB of memory, but we provision them with 1024MB of memory just to get that CPU and reduce execution time.
  2. HTTP requests - Make only a single HTTP request for each function invocation, if possible.
  3. Blocking I/O - mParticle will invoke your AWS function from the AWS US East availability region - so your lambda function should be deployed in same US East region. Try to only make blocking I/O requests to other APIs physically nearby (rather than to the West Coast, for example). You can provide additional ARN endpoint to support data centers in different regions. This will provide improved latency for customers located within the different data centers supported by mParticle.
  4. Memory - Keep expensive objects in memory. When mParticle invokes your Lambda function for the first time, AWS will immediately provision a machine for it. When repeated invocations are made over the span of minutes/seconds, that same machine/memory space will be used. This means that you should keep every object in memory that you can. A simple example of this is shown in our sample Firehose function. We allocate the MessageSerializer object as a member of the RequestStreamHandler instance. On subsequent invocations, the handleRequest function will be called on the same RequestStreamHandler instance, and therefore not waste time creating another MessageSerializer object.

    • The above point is particularly useful if you’re using an HTTP client or other I/O library that can reuse connections. Keep that client in memory as a member of your RequestStreamHandler instance, if possible.
  5. Asynchronous I/O - AWS Lambda will allow you to create new threads, use thread pools, etc. If the above pointers still don’t help, you could always make your I/O requests completely asynchronous. Particularly for AudienceMembershipChangeRequests, you can queue your API request and return a standard AudienceMembershipChangeResponse to mParticle. There are several HTTP client libraries such as Retrofit/OkHttp which make this really easy.

Lambda Throttling

mParticle servers will stream data to your function at the same rate at which it is received. If your Lambda function cannot process the data as fast as mParticle is sending, mParticle will be throttled and will receive a 429 Too Many Requests error code.

The default Lambda limits are:

  • The requests per second limit is 1000, which is account wide.
  • The concurrent requests limit is 100, which is account wide.

Before publishing an integration, the concurrent requests limit must be increased to a minimal value of 1000 to prevent throttling. Once the request has been submitted to AWS, mParticle can assist in escalating the ticket for completion. The following parameters are suggested values which can be used in the request:

  • Expected Average Requests Per Second - 2,000
  • Expected Peak Requests Per Second - 10,000
  • Expected Function Duration in Seconds - 1
  • Function Memory Size - increase to a minimum of 256
  • Invocation Type - Request-Response
  • Event Source - HTTP API
  • Use Case Description - High volume function

Refer to the AWS documentation for additional details on AWS Lambda Limits and Scalability and Availability

You can also check your current usage on the CloudWatch console by selecting Lambda below Metrics in the left pane. In the right pane, select Throttles as Metric Name and you should see anything you’re being throttled on within Lambda. A good guide would be to take the highest number, and request 50% more than that. You can request a higher limit by opening a case with AWS Support.

Keep this in mind as you’re developing your Lambda function as it may determine how it should process and to which of your APIs you should send data. Data rate and volume will depend on:

  • The size of the customer that has enabled your integration.
  • The amount of/types of data for which you register
  • If you have registered to receive Audience data, the volatility and size of a given customer’s audiences.

Latency Requirements

mParticle requires an average response time of under 200ms for 99% of all calls to your Lambda function.

  • Testing - If during testing and review, the integration partner is unable to meet latency requirements, the integration will not be approved and made available in the mParticle Platform.
  • Released - If the integration has been released and available to customers and latency drops below expected requirements, mParticle will within our best effort notify you immediately. If integration partner is unable to remedy latency concerns within a reasonable time-frame, mParticle may disable the integration until latency requirements are met.

HTTP Integrations

The HTTP integration method will make HTTP calls over TLS 1.1+ using the same protocol and integration methodology that AWS Lambda integrations use, except that it calls a nominated HTTP endpoint directly.

Endpoint Requirements:

  1. The endpoint must be HTTPS.
  2. The endpoint should be located in the East Coast United States. You can provide additional endpoints to support data centers in different regions. This will provide improved latency for customers located within the different data centers supported by mParticle.
  3. Response latency must be under 100ms in order to ensure necessary throughput can be maintained. We suggest requests are accepted and queued for asynchronous processing.
  4. mParticle will send calls with an Authorization header. You can choose whether to authenticate mParticle as the caller with this header. The format will be “Authorization : Token [token]”. This token value will be provided to you by email, encoded with a PGP encryption key you provide. To generate a token, mParticle needs to be able to import the ModuleRegistrationResponse, so this response should not require authentication.
  5. Responses

    • mParticle expects to receive a 200 (OK) or a 202 (Accepted) response for all requests.
    • By default, retries will occur for the following responses. mParticle will attempt a limited number of retries in an exponential backoff pattern.

      • 408 - Request Timeout
      • 429 - Too Many Requests
      • 500 - Internal Server Error (generic error message)
      • 502 - Bad Gateway
      • 503 - Service Unavailable
      • 504 - Gateway Timeout
    • All other error codes will not be retried.

For more information about API throttling in response to a 429 response see Default Service Limits.

The endpoint must accept the same JSON format as the Lambda API. Samples of the JSON requests can be found here. The following methods should be supported:

  1. Registration

    • ModuleRegistrationRequest - POST URL returning the JSON module registration response. For more detailed information about the module registration response, see the Firehose Java SDK docs
  2. Event

    • EventProcessingRequest - POST URL returning an EventProcessingResponse
  3. Audience

    • AudienceSubscriptionRequest - POST URL returning an AudienceSubscriptionResponse
    • AudienceMembershipChangeRequest - POST URL returning an AudienceMembershipChangeResponse

Don’t forget to provide a high-resolution logo to mParticle in SVG format with a transparent background.

Cookie Sync integrations enable mParticle to sync mParticle profiles with Partner Identities. The Partner ID will be included in AudienceMembershipChangeRequest messages only to the specific partner that the ID corresponds to. To configure a Cookie Sync integration with mParticle please reach out to us with the following information:

  • What is the endpoint mParticle should call on the partner site? This URL must be https.
  • Should mParticle provide a redirect URL in the pixel call?
  • Should mParticle register separate URLs for each data center?
  • What macro is used to specify the partner ID mParticle is receiving?
  • How frequently (in days) should mParticle do the cookie exchange? Default is 14 days.
  • How will the partner treat extra parameters? mParticle will include parameters that must be echoed back in the cookiesync.mparticle.com redirect
  • What does the redirect request look like?
  • Will the partner accept an HTTP 204 status code?
  • Will the partner return any error codes in the redirect URL?

Was this page helpful?

    Last Updated: November 27, 2024