Facebook Login is a new way of allowing access to Audience Network Reporting API data. This approach will be replacing the old copy-pasting system user token from Monetisation Manager interface. This approach is a more secure way of giving access to your data, due to the risk of Monetisation Manager token getting exposed outside of the business.
This document focuses on providing guidance for direct reporting API integrations, Mobile Measurement, Mediation and other Facebook partners that are working on accessing Reporting API data on behalf of publishers.
If you are using the existing partner (Mobile Measurement or Mediation Partner), there’s no additional coding work required from you. Make sure that your partner integrates Facebook Login flow. You will have to click on the “Login with FB” option and select the properties that you want to give access to with the token that you will generate.
If you select ALL properties, the token will provide access to all the properties under the Business as long as the user that created the token has access to the property in the Business Manager.
If you need to use the Reporting API directly, you’ll firstly need to create a Facebook app and obtain required permissions. Your app will need read_audience_network_insights
permission to access Audience Network Reporting API data. In order to get this permission for your app, the business needs to be onboarded to Audience Network.
Your application is now onboarded to Audience Network and can use the read_audience_network_insights
permission. If you can't see the read_audience_network_insights
make sure that the app is linked to a Business that has access to your Monetization Manager Business account.
If you have previously obtained read_insights permission
with Facebook Login, this will still work but we suggest moving to read_audience_network_insights
permission.
The way you approach accessing the Reporting API will vary depending on the type of integration that you have. Please follow the instructions that apply for your case:
If you have a custom (direct) Reporting API integration without any frontend/UI interface and you use it to query the data for your business only, you can use the following instructions to get access to Reporting API.
You can now access Audience Network Reporting API data with this token.
The following guide is useful for publishers and partners with their own UI interface on which Facebook Login button can be placed. This guide will be useful for publishers willing to access their own data, as well as partners who would like to access other publishers monetization data with their permission.
You can also check the end-to-end demo video of the following guide including permissions step from above:
read_audience_network_insights
” permission instead of the suggested “public_profile,email
” permissions. With the updated permission your button code should look like this: <fb:login-button scope="read_audience_network_insights" onlogin="checkLoginState();"> </fb:login-button>
statusChangeCallback
JavaScript method from previous steps.Error Message | What it Means | Action / how to solve |
---|---|---|
Reading insights of a Page, business, app, domain or event source group not owned by the querying user or application | For Facebook Login token, it means that either the app issuing token doesn’t have sufficient permissions ( | The Business admin needs to provide access to all the properties to the user that wants to generate the token or has generated the token. |
Missing or Empty data | This normally means that all or some of the data was filtered using our privacy aggregation. This can also be validated against MoMa data. | Check if there is an |
| The app created to generate the token was not created as type Business and that the app has been linked to your Audience Network Monetization Manager. | Ensure that you are creating the App to generate a token as a Business. Try to create a new app and ensure you follow the instructions under the Permissions section. Go to developers.facebook.com/apps and select the app that you can't see |
| The token has expired | Please ensure that the token is converted into a Long Live token. Follow the instructions under the "Turn this token into the Long-Lived access token" section Long Live tokens are refreshed once per day, when a Reporting API request is made to Facebook's servers. If no requests are made, the token will expire after about 60 days and the person will have to generate a new token. |
Two Apps with the same name are showing | Check if one app has | Use the app that has the correct |
(#200) The way to access reporting API v2.0 has changed. You now need to implement Facebook Login for your app to access this API. | You are not using credentials to access the API in the new way. | Ensure you are creating a new app from scratch (only to be used for creating tokens) and that you are creating it as Business type. |