Facebook Connector FAQ
Selecting an API Version
When using the Facebook Query component, always make sure you’re using the latest version of Matillion, since the Facebook driver gets frequently updated.
If you need to use a specific API version, add a Connection Option named Version and set its value to a valid decimal or integer without quotes or punctuation. e.g. 2.12 or 3.1.
In order to authenticate successfully, you must have Facebook OAuth credentials, with appropriate scopes enabled. See this article for a step-by-step guide.
In order to successfully set up OAuth for Facebook, you must be accessing Matillion over HTTPS (not HTTP). Please refer to this article for more information about configuring HTTPS.
Error message: “An unknown error occurred”
This error message can be thrown by Facebook APIs under two common circumstances:
- When versions become deprecated (see above).
- When the API call tried to retrieve too much data.
If you are using the latest version of Matillion and still receive “an unknown error occurred”, try restricting the data volumes, for example by reducing the date range in the query. Note that setting the “limit” property of the component probably won’t make any difference in this respect.
It might also be possible to use the asynchronous API. In advanced mode try adding a predicate on UseAsync. e.g.
SELECT ... FROM AdInsights WHERE UseAsync=True
Error message: “You are calling a deprecated version”
Occasionally Facebook APIs will throw this more specific error due to version deprecation. It’s the same underlying problem as the “an unknown error occurred” listed above.
Error message: “A target must be specified”
Virtually all of the Facebook data sources require that you provide a “Target” in the query. The “target” depends upon the context, and might for example be a Page, an Ad, an AdSet or a Campaign. You specify the target by adding an equality predicate on “Target” inside the Data Source Filter property on the component.
Within Business Manager, it’s possible that when you refresh a report for a specific date range, there will sometimes be a discrepancy between the old and new results. This is a feature of Facebook, and you may find the same thing happening with the Matillion ETL Facebook Query because it uses the same APIs.
Specifying date ranges
Some Facebook queries allow you to specify time ranges, for example using DateStart and DateEnd. The date format is DD/MM/YYYY for these. Incorrect date formats can sometimes result in strange errors along the lines of “Cannot compare data type of class java.lang.Double to class java.util.Date”
Some Facebook queries allow you to specify magic strings for date ranges such as DatePreset = 'yesterday'
Querying Authenticated as Page
Connection Option for this, which you can set with the Parameter AuthenticateAsPage and the Value set to the Page ID.