Export API

The App Events Export API allows you to export and download 24 hours worth of app event data from the day before the query up to 30 days old as a compressed .gz file. You can then import the file into your own data warehouse or other system for further analysis.

Get started with our Graph API endpoints and use your app access token to download the fields associated with your app events. Visit our FAQs for more on app events exports.


Workflow

1. Create a request from the Graph API

2. Query your request status

3. Download the export file

Exported Fields

FieldDescription

server_time

timestamp at which the server receives the event

event

app event name

app_version

version of the app

numeric_data

numeric data that came with the event

event_log_time

timestamp at which the event is logged

custom_parameters1~custom_parameters25

all 25 custom parameters

analytics_app_id

MMP

app ID if applicable

ad_tracking_enabled

whether this event can be used to inform ads targeting

usd_amount

the USD amount associated with the event

user_agent

user agent of the device

timezone

timezone of the device

carrier

carrier of the device

screen_dimensions

screen dimension of the device

total_disk_gb

total disk space of the device, in GB

remaining_disk_gb

remaining disk space of the device, in GB

invoking_ui_element

invoking UI element from where the event comes

is_device_id_anonymous

whether the unhashed device ID is an anonymous ID

raw_advertiser_id

unhashed device ID


Note: These fields may change with feature modifications in Facebook Analytics.

1. Create a Request

Use the Post method with the syntax below to run an export:

HTTP POST to
https://graph.facebook.com/v2.6/[Application FBID]/analytics_app_events_exports 

POST data
access_token = {app access token}
start_ts = linux timestamp, PST time
end_ts = linux timestamp, PST time

Example:
HTTP POST to

https://graph.facebook.com/v2.6/[Application FBID]/analytics_app_events_exports

POST params
access_token = {####}
start_ts = 1447373454
end_ts = 1447376454

Once this is successful, you will receive the FBID of the newly created export object, e.g., {"id": "12345"}.

Once an export job is created, it will run for 1-2 hours, during which you can query the status of your request. Once the export status has been marked as Completed, you can download the file from an HTTP GET endpoint.

2. Query Request Status

Query a Single Export

To query the status of a single export job, use the following syntax:

HTTP GET to
https://graph.facebook.com/[GraphAPI version]/[Export FBID]?access_token={app access token}

Example:

https://graph.facebook.com/v2.6/[Export FBID]?access_token={####}

The resulting status will include ID, start_ts, end_ts, and status, as stated in the following example:

{  
  "id": "##############",
  "start_ts":"1970-01-01T00:02:03+0000",
  "end_ts": "1970-01-01T00:02:04+0000",
  "status": "RUNNING",
  "column_names":[Columns mentioned above],
  "event_param_names":[{"event_name":[Event name]',"param_names":[Custom param names]}]
}

Query All Exports

For queries on all exports of a single app, use the following syntax:

HTTP GET to
https://graph.facebook.com/[GraphAPI version]/[Application FBID]/analytics_app_events_exports?access_token={app access token}

Example:

https://graph.facebook.com/v2.6/[Application FBID]/analytics_app_events_exports?access_token={####}

The data for all exports associated with this app will appear in the following example format:

{
  "data": [
    {"id": "################", "start_ts": "1970-01-01T00:02:03+0000", "end_ts": "1970-01-01T00:02:04+0000", "status": "RUNNING","column_names":[], "event_param_names":[]},
    {"id": "#################", "start_ts": "1970-01-01T00:02:03+0000", "end_ts": "2015-10-30T07:36:04+0000", "status": "SCHEDULED","column_names":[], "event_param_names":[]}
  ]
}

3. Download the Export File

To download your file, follow the syntax below:

HTTP GET to:
https://lookaside.fbsbx.com/analytics/app_events_export/download

GET query params:
access_token={app access token}
id = the export object FBID
filename = the desired filename

Example:

https://lookaside.fbsbx.com/analytics/app_events_export/download?access_token={#####}  

GET query params:
access_token={####}
id = ##############
filename = output.gz 

The output file is a text file compressed in .gz format. Rows are separated by \n, fields are separated by comma, and NULL could be represented by 'u' or '\N'. Note the retention time for the file is 4 days.

Example (uncompressed):

1234567,fb_mobile_activate_app,1.37,0,1446281193,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,############,false,\N,adjust.com,\N,\N,\N,\N,\N,\N,0a5ca6c0f4fe638803c48915637fb282,\N,\N
1446318771,fb_mobile_deactivate_app,11295,2000,1446282564,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,\N,true,\N,FBiOSSDK.3.24.0,\N,\N,\N,\N,\N,\N,8d1cb373e4479f1c126dcdeab245e886,\N,\N
....

FAQ

Can I access the demographic data of people using my app?

No, we don't support exporting demographic data at the device level.


Can I access hardware fields if I've sent app events through a Mobile Measurement Partner (MMP)?

If the MMP supplied that information, then it will be included. Facebook won't augment or otherwise add to any exported data.


How often can I submit a request?

You can submit one request every 2 hours per app.


How far back can I see my data in each request?

You can see 30 days' worth of data from the request date.


Is there a data limit if I work on an app that sends app events in high volume?

Yes, there is a data limit of 40 GBs, or 1 billion app events.


Can I filter or choose which fields I'd like to export?

No, you can't choose specific fields to export at this time. You'll receive all exported fields in each request.


Can I download data from multiple requests at the same time?

Yes, but there's a download limit of 3 times every 5 minutes per app, across all requests.


What file type does my data come in?

Once you've pulled the file from the content delivery network (CDN), you can download it as a .GZ file.