Exporting Bookmarked Reports

Using the "exportReport" API call, we can export bookmarked reports from the dashboard.

Step 1 Create the bookmarked metric

For our example, we are going to look at the metric "Weekly Active Users". We will apply the filter "OS name is iOS and City is San Francisco". We can then book mark this metric and name it as "LP Weekly SF and iOS"

Step 2 Export the metric with exportReport

https://www.leanplum.com/api?appId=<app_id in app settings>&clientKey=<export key in app settings>&apiVersion=1.0.6&startDate=20160601&endDate=20160607&action=exportReport&dataType=BookmarkedReport&bookmarkName=LP Weekly SF and iOS

The above API call will create a job ID in the response. Make sure to fill in the start and end date that you would like.


{
    response: [
       {
          jobId: "report_3936002_0400cd02-1754-468d-8beb-6456345142",
          success: true
       }
   ]
}

Step 3 Retrieve the results with getExportResults

https://www.leanplum.com/api?appId=<app_id in app settings>&clientKey=<export key in app settings>&apiVersion=1.0.6&action=getExportResults&jobId=report_3936002_0400cd02-1754-468d-8beb-6456345142

Step 4 Interpreting the Results

The response will contain all of the bookmarked metrics. Here are some sample ones. The JSON output is partitioned by date.

In this case, our base metric was Weekly Active Users, and it will be Total weekly users here

Basic Stats:


{
  Total first-time users: 20,
  Total session length: 33,
  Retained 14th day: 4,
  Total users from 3rd day: 19,
  Total weekly users: 2023,
  Retained 3rd day: 2,
  Retained 7th day: 8,
  Total users from 30th day: 22,
  Sessions with time: 2042,
  Total sessions: 2298,
  Total users from 1st day: 40,
  Retained 30th day: 1,
  Retained 1st day: 21,
  Total monthly users: 4252,
  Total users from 7th day: 35,
  Total daily users: 734,
  Total users from 14th day: 42
}

 

API Response Name Dashboard Metric Name

Total first-time users

Total first-time users

Total session length

Total session length

Retained 14th day

Numerator for the metric 14-day retention

Total users from 3rd day

Denominator for the metric 3-day retention

Total weekly users

Weekly Active Users

Retained 3rd day

Numerator for the metric 3-day retention

Retained 7th day

Numerator for the metric 7-day retention

Total users from 30th day

Denominator for the metric 30-day retention

Total sessions

Total Sessions

Total users from 1st day

Denominator for the metric 1-day retention

Retained 30th day

Numerator for the metric 30-day retention

Retained 1st day

Numerator for the metric 1-day retention

Total monthly users

Monthly active users

Total users from 7th day

Denominator for the metric 7-day retention

Total daily users

Daily active users

Total users from 14th day

Denominator for the metric 14-day retention

 


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