Excel Add-In for Facebook Ads

Build 21.0.8137

Establishing a Connection

Configure a Connection Profile

From the CData ribbon, click Get Data and select From Facebook Ads connection/s to launch the CData Query window. To setup a new connection, you will have to click the New Facebook Ads Connection button. Here you can set the connection settings, test the connection, and save the connection profile.

Authenticating to Facebook

Facebook Ads uses the OAuth standard to authenticate users.

Authenticate via OAuth Authentication

You can connect without setting any connection properties for your user credentials.

When you connect, the add-in opens the Facebook Ads OAuth endpoint in your default browser. Log in and grant permissions to the add-in. The add-in then completes the OAuth process.

See Using OAuth Authentication for other OAuth authentication flows.

Posting as a Page

After authenticating to Facebook Ads with your user account, you can post, etc. as one of the pages you manage: Set the AuthenticateAsPage property to the Id of the page you want. You can find the Ids for all pages your account has access to by querying the Pages view.

Automatic Page Authentication

Facebook Ads has made a number of recent changes that require page tokens for most resources owned by a page. This can be troublesome if you manage multiple pages and want to execute the same queries across all pages (such as retrieving Insights). In order to make this work seamlessly with our tools, we have added a way to automatically detect the page token to use. For this to work, simply do not specify the AuthenticateAsPage. Note that the correct page token can only be resolved if the page id is specified as part of the target in the request. This means for some requests you will still need to manually specify AuthenticateAsPage.

Requesting Additional Permissions

You may find while using the add-in that Facebook returns an error stating your app does not have permissions to do a certain action. To resolve this, you will need to generate a new OAuth access token with the required permissions. Set the Scope property in the authentication step.

You can find a list of available Facebook permissions here: http://developers.facebook.com/docs/authentication/permissions/.

Fine Tuning Data Access

  • Target: Some Facebook tables can be filtered by a target. For example, to retrieve comments on a video, specify the Id of the video as the target. This property enables you to restrict the results of all queries in the connection to records that match the specified target. You can also specify this restriction per query with the Target column.
  • AggregateFormat: The add-in returns some columns as a string aggregate. For example, the available likes data for an entity is returned in aggregate. By default, the add-in returns aggregate columns in JSON. You can also return aggregates in XML.
  • Version: Set this property to the Facebook Ads API version if you need to work with a different version than the default.

Connection Properties

The Connection properties describe the various options that can be used to establish a connection.

Managing Connections

After successfully authenticating to Facebook Ads you will be able to customize the data you are importing. To learn more about this, see Managing Connections.

See Also

Copyright (c) 2022 CData Software, Inc. - All rights reserved.
Build 21.0.8137