Facebook Graph Batch API (facebook/graph
)
operated by: Facebook
(get company information on datarequests.org)The Graph API is provided by Facebook to “get data into and out of the Facebook platform”. It can be accessed through the Facebook SDKs for Android and iOS .
The App Events endpoint allows developers to “track actions that occur in [a] mobile app or web page such as app installs and purchase events” in order to “measure ad performance and build audiences for ad targeting”. The Facebook SDK automatically logs app installs, app sessions, and in-app purchases using this endpoint. Additionally, developers can manually log their own events.
Endpoint URLs
These are URLs or regexes of endpoints the tracker sends data to. We use these to determine which adapter to apply to a request. Some trackers use the same endpoint for several formats. In this case we use additional logic to match the adapter to the request, refer to the code for more information./^https:\/\/graph\.facebook\.com\/v\d{1,2}.\d$/
Decoding steps
Every tracking library has its own way of transmitting tracking data, often even several. They are regularly pretty convoluted, nested encoding schemes. Because of that, the adapter needs to decode the request information into a consistent format. We try to keep keys and paths intact, but the structure results from our decoding. All steps used in the decoding for this adapter are documented here.- Parse the request body as JSON. Store that in the variable
b
. - Parse the property at JSONPath
batch
in the variableb
as JSON. Store that in the variablebatch
. - Get the property at JSONPath
relative_url
for every element in the variablebatch
. Store that in the variablerelativeUrls
. - Parse every element in the variable
relativeUrls
as a query string. Store that in the result for the request body atbatch
. - Get the property at JSONPath
batch_app_id
in the variableb
. Store that in the result for the request body atbatch_app_id
.
1b = parseJson(body)
2batch = parseJson(b.batch)
3relativeUrls = getProperty.map(batch, {"path":"relative_url"})
4res.body.batch = parseQueryString.map(relativeUrls)
5res.body.batch_app_id = b.batch_app_id
Observed data transmissions
This is data that we observed being transmitted by this tracker. Not every request contains all of this data. The context of the data describes where we found the data in the request, the path describes the location of the data in the decoded request. The examples are a selection of observed values.References
- Documentation for
batch.*.advertiser_id
: https://developers.facebook.com/docs/graph-api/reference/v17.0/application/activities - Documentation for
batch.*.app_user_id
: https://developers.facebook.com/docs/graph-api/reference/v17.0/application/activities - Documentation for
batch.*.device_token
: https://developers.facebook.com/docs/graph-api/reference/v17.0/application/activities