Facebook Graph Batch API

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”. Source It can be accessed through the Facebook SDKs for Android Source and iOS Source .

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. Source

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.
  1. Parse the request body as JSON. Store that in the variable b.
  2. Parse the property at JSONPath batch in the variable b as JSON. Store that in the variable batch.
  3. Get the property at JSONPath relative_url for every element in the variable batch. Store that in the variable relativeUrls.
  4. Parse every element in the variable relativeUrls as a query string. Store that in the result for the request body at batch.
  5. Get the property at JSONPath batch_app_id in the variable b. Store that in the result for the request body at batch_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.
PropertyContextPathExamples of observed values
App IDbodybatch.*.application_package_name
Device advertising ID (GAID/IDFA)bodybatch.*.advertiser_id Tracker documentation on this property00000000-0000-0000-0000-000000000000
F04C6D92-D4FA-4CA4-AC62-DE94C8C2DAE7
OS namebodybatch.*.sdkios
Other unique identifiers for the user, device, session, or installationbodybatch.*.anon_id More details on how we identified this propertyXZC26F05DF-94B7-41A6-AA93-FF3D4179E6DD
XZ7CA86014-43A0-463E-B0C1-A99F5666A1E7
XZA1964B79-5236-4744-B9B0-F910F28BEBCD
XZABCB7B81-9419-4A93-9DE4-ED3EC44F81E4
XZ7587BD00-BD1B-4864-8F14-C1D90D2DB000
bodybatch.*.app_user_id Tracker documentation on this property4ebcc682-4a07-4edc-bf18-275a49cbae21
bodybatch.*.device_token Tracker documentation on this property31b29d5217f8ab062ed17e142b23f8fc4dc2ed2845915a37003c15111f95d0b5
References