Kitewheel has integrated with the Facebook Graph API. This allows your brand to link up customer data to power automated real time audience management such as add/ remove users from custom audiences or even create new audiences.
What is a Facebook Ad Audience?
The Facebook Ad Audience is a set of data to identify (or specify the demographics/ characteristics) users that you desire to expose the ad to. This is defined by a marketer and uploaded to the Facebook Marketing Platform.
There are two methods for creating and maintaining an Ad Audience:
- The Facebook Marketing Manager interface: https://www.facebook.com/ads/manager
- The Facebook Marketing API: https://developers.facebook.com/docs/marketing-apis
How does the Facebook Marketing API work?
The Facebook Marketing API can be used via a series of Authenticated (OAuth2) RESTful API calls. The first step to obtain a User Access Token requires a Facebook login (manual) however requesting extended and refreshing tokens can be automated. Creating and managing Audiences can also be automated.
Marketing API Quickstart
Follow steps 1,2,3,4,6 in https://developers.facebook.com/docs/marketing-api/quickstart
Package contents
- Connections
- facebookGraphAPI - REST web service - used for all operations
- Graphs:
- testAudienceCalls
- addProfileToCustomAudience
- removeProfileFromCustomAudience
- Public Variables:
- fbAccessToken - current value of the access token - populated from appParams public variable
- fbAudienceId - value of the audience identifier to be used for operations
- Schema
fbContact - hold the fields for a Facebook contact
Code Block language js { "fbContact": { "email": "", "emailHash": "" } }
Setup
See the first part of this article on how to create the/wiki/spaces/TV/pages/23625732.
- Follow the instructions for the setup of the application parameters custom graph template
- Create application parameter values in the application parameter table with the following paramKeys:
- fbAppToken
- Sample SQL Insert statements:
Code Block | ||
---|---|---|
| ||
INSERT INTO appParams(paramKey,paramValue,paramType,description) VALUES
('fbAppToken', 'YOURTOKEN','string' 'Facebook Application Token'); |
Using
- fbAddToCustomAudience
- Expects the public variable fbAudienceId to be set appropriately
- Expects the Email address to be in the email field of the fbContact schema location
- Returns true on success