Exporting data

You can export raw user engagement data, export lists of users that match certain criteria, or export analytics reports. You can also add postbacks to stream data to another location when those events occur. Additionally, you can retrieve information about A/B tests or messages created in the Leanplum dashboard. Any of these methods can be used to retrieve data from Leanplum for further analysis in your internal systems.

Raw user activity data can be exported by using our Leanplum data feeds or one of our partner integrations.

Leanplum feeds

Leanplum feeds allows you to export all of your Leanplum engagement data to a cloud storage of your choice. The data will be delivered with an easy-to-read schema and plenty of metadata to power you analytics and data science models. We support the following cloud storages:

Amazon S3 Cloud Storage

Google Cloud Storage

Our data feeds are also integrated with a number of best-in-class analytical and customer data platforms:

Amplitude
Segment
mParticle
Mixpanel

Postbacks for Messaging Events

When you want to analyze message events, such as sends, opens, clicks, etc., Postbacks are an automated way for Leanplum to communicate this information to another source in real-time. By adding an API Endpoint to Leanplum’s Postback list, Leanplum will forward all messaging events to this endpoint.

See our API documentation for how to Add a Postback .

Webhooks

Webhooks are a flexible message channel in Leanplum that allows you to trigger messages from other platforms directly from the Leanplum Dashboard. With a webhook, you can target, trigger, and test messages as you would with other channels. Webhooks allow you to define an API endpoint, and whenever a user triggers the campaign Leanplum will make a request to this endpoint.

An example of a webhook campaign would be using the API of an SMS provider to send text messages to a user.

Raw Data Exports (API)

All data from Leanplum can be exported. This includes the ability to manually pull data or have raw data exports automated for you. For instances in which all of Leanplum’s data is required, the Raw Data Exports is the method to use. This includes all data sent to Leanplum from a user, including all attributes and events tracked for every user.

Learn more about how to use the REST API to export.

Leanplum’s raw user activity data contains information about:

  • a user’s attributes
  • device information
  • events a user has triggered
  • states a user has reached
  • messages a user has been sent
  • A/B tests a user has been a part of

User CSV Downloads

In the Leanplum Dashboard, CSV lists can be downloaded from Audiences. This is useful when you need a list of User IDs for a targeting list in another platform. You can also use Leanplum’s segmentation capabilities in Audiences to query a target list of users, and then download the resulting list of User IDs for use outside of Leanplum.

See how to Download users in an audience.

Automatically send raw data to an S3 Bucket

To send raw user activity data to an Amazon S3 bucket, navigate to the App Settings page by clicking on the App Selection menu at the top of the screen, and select Manage Apps (Note: This menu will be accessible from any page of the Leanplum platform).

Once in the App Settings page, do the following:

  1. Find the app you wish to enable automatic exports for and click on the Keys & Settings link (Note: This requires your account to have Admin or Member privileges for that team)
  2. Click on the Export tab
  3. Enter your AWS access ID, access key, and S3 bucket name
  4. Enter an S3 object prefix (optional)
  5. Decide whether you’d like to receive compressed files in gzip format, and if so, check the checkbox to the right of Compress files (gzip)
  6. Decide the frequency with which you’d like to receive the export
  7. Click Done
2654

More on how to consume the exported data can be read here.

🚧

If you export Leanplum data to an S3 bucket, you are responsible for handling GDPR, CCPA or other privacy requests involving the exported data.

Collect A/B test data using our SDK

If you're working with a large number of users and want to track their involvement with all of your A/B tests, another option is to call Leanplum.variants() after start(). This method returns a list of dictionary items with the user's current variant IDs for A/B tests, which you can then send to your server.

[
    {id=6462488122490880},
    {id=0000000000000000}
]

🚧

Important

It's best practice to wait for Leanplum to finish syncing before calling Leanplum.variants(), to ensure the variants data is as up-to-date as possible. You can do so using callbacks, specifically the onStartResponse (iOS) and addStartResponseHandler (Android) methods which are fired when the start call is completed. Learn more about using Callbacks.

Callbacks

From there, you can call our API with the action getAbTests, which will return all of your A/B tests, with nested arrays of variants for each. This will allow you to map each user's variants back to an A/B test.

{
  "response": [
    {
      "abTests": [
        {
          "id": 5108342379249664,
          "created": 1478637286.809,
          "name": "Welcome Message a/b test",
          "variants": [
            {
              "id": 6462488122490880,
              "percent": 50,
              "name": "Control"
            },
            {
              "id": 6117096423948288,
              "percent": 50,
              "name": "Disable Welcome Message"
            }
          ],
          "active": true
        }
      ],
      "success": true
    }
  ]
}