Exporting Leanplum Push Notification Events to Other Analytics Providers

This guide outlines three different methods to export Leanplum push notification messaging events to other analytics providers. The events will be exported on a per-user basis (as identified by their user id on Leanplum) so that you will be able to carry out analysis on your users on your Provider.

For push notifications, there are two kinds of messaging events to track: Sends and Opens.

Method 1: Postbacks

Leanplum can be configured to automatically send a postback to a URL endpoint of your choice every time Leanplum sends a push notification, and another postback every time a user opens a push notification. The postback payload contains:

  • {{User ID}}: The user ID that triggered the postback.
  • {{Device ID}}: The device ID that triggered the postback.
  • {{Trigger time}}: The time in milliseconds at which the postback was triggered. The time can be a time in the past if the triggering event occurred in the past.
  • {{Message ID}}: The message ID that triggered the postback.
  • {{Message event}}: The message event that triggered the postback (e.g. Send, Open).

The endpoint could either be an endpoint at your Provider, or it could be your own backend service which can collect this data for future delivery to your Provider.

Benefits:

  • Data is transmitted in real time.
  • Data is specific for messaging events, so you don't need to further process the data.
  • If your Provider has an API endpoint for collecting event data, the data can be sent directly from Leanplum to the Provider, eliminating the need for you to build anything in between.

Caution: If you send a Scheduled campaign (e.g. a campaign to all or most of your userbase), this may result in a high volume of postbacks being sent. Be sure that your endpoint can support this level of traffic. You could also configure your app for Push Notification Throttling to slow down the delivery of your blast campaign.

If your app mostly uses Lifecycle campaigns, then this is less of an issue since the pushes are sent in reaction to individual user behavior, rather than sent out all at the same time.

See more on addPostback.

Method 2: exportUsers

This method is suitable if you need to export data on messaging campaigns after the campaign is completed, or at a specific point during the campaign's life.

You can run an API query to export the list of users who have been sent a particular message.

For example, to see a list of all users who have been sent Message ID 6414704138780672 to date:

https://www.leanplum.com/api?appId=YOUR_APP_ID&clientKey=YOUR_DATA_EXPORT_KEY&apiVersion=1.0.6&action=exportUsers&segment=Occurrences of ".m6414704138780672" > "0"

This query would return the list of all users who opened Message ID 6414704138780672 to date:

https://www.leanplum.com/api?appId=YOUR_APP_ID&clientKey=YOUR_DATA_EXPORT_KEY&apiVersion=1.0.6&action=exportUsers&segment=Occurrences of ".m6414704138780672 Open" > "0"

The response will be a JSON-formatted array of all the user ids who match your query. You can then upload this list to your Provider.

See more on exportUsers.

Method 3: exportData

You can use exportData to continuously export all Leanplum raw data in JSON format. This gives you maximum flexibility, as the data will contain all event and messaging data for all of your users. You may need resources from your data warehouse team to ingest and process the raw data, and then upload to your Provider.

The raw data can be pulled from Leanplum using the exportData API call, or you can configure Leanplum to automatically push the raw data to an AWS S3 bucket of your choice.

See more on exportData.


Was this article helpful?
Have more questions? Submit a request