Custom audiences allow advertisers to target their Sponsored Story or Ad to a specific set of users with whom they have already established a relationship on/off Facebook. Audiences can be defined by either user email address, Facebook UIDs, user phone numbers, or app user IDs. When utilizing Facebook UIDs please ensure you comply with Section II of the Platform Policies.
curl -F 'name=testAudience'
https://graph.facebook.com/act_adaccountid/customaudiences?access_token=___
If successful, the above call with return an ID for the newly created audience.
{id: 12345}
curl https://graph.facebook.com/act_adaccountid/customaudiences?access_token=___
Users can be added to audiences either using a hash of an Email Address, their Facebook ID, their Phone Number, or their App User ID.
curl -F 'users=[{"email_hash":"MD5"}, {"email_hash":"MD5"}, {"email_hash":"MD5"} …]'
https://graph.facebook.com/{audience_id}/users?access_token=___
There is no max on the total number of users that can be added to an audience, but up to 1000 users can be added at a given time.
If the addition of the user succeeds, the API call will return true.
Note: It may take up to 1 hour before the users are added to the audience.
DELETE /{audience_id}/users/
users=[{…}]
curl -F https://graph.facebook.com/{audience_id}?access_token=___
Sample response:
Response
{
"id": "6004192254512",
"account_id": 38847137,
"name": "customaudience",
"parent_category": "Custom",
"type": 4,
"type_name": "Advertiser Generated",
"time_updated": 1348480901,
"approximate_count": 20,
"status": "ready",
"subtype": 0,
"subtype_name": "REGULAR"
}
| Name | Description | Type |
|---|---|---|
| id | The ID of this category | long |
| account_id | The ID of ad account which this audience belongs to | long |
| approximate_count | Approximate number of people in this audience | int |
| lookalike_audience_ids | The IDs of the lookalike audiences generated from this audience | array |
| name | The name of this audience | string |
| parent_audience_id | Parent audience ID; set this field if audience hierarchy is desired | long |
| parent_category | Type of the parent audience weather it is custom audience (e.g. Custom), partner category (e.g. Acxiom) or broad category (e.g. Activities) | string |
| status | Current status of the audience (e.g. ready, waiting, error) | string |
| subtype | Subtype of the custom audience (e.g. 0->custom audience, 2->lookalike audience) | string |
| subtype_name | Subtype of the custom audience (e.g. Regular->custom audience, Lookalike->lookalike audience) | string |
| type | User cluster type (e.g. 4->custom audience, 6->broad categories) | string |
| type_name | Name of the cluster type (e.g. Advertiser generated->custom audience, BCT->broad categories) | string |
| time_updated | Last time this audience was updated | long |
Custom Audiences can be used alongside existing Broad Categories
targeting:{
'countries':['US'],
'user_adclusters':[{'id':6002714885172,'name':'Cooking'}],
'custom_audiences':[{'id':6004192254512,'name':'customaudience'}]}
Advertisers can exclude a custom targeting audience from seeing an Ad or Sponsored Story as follows:
targeting:{
"countries":["US"],
"age_min":25,
"age_max":40,
"excluded_custom_audiences":
[{"id":"6004192254512","name":"customaudience"}],
"broad_age":false
}
See the Advanced targeting section of the targeting spec doc.
You can choose to send us only the MD5 hash or compute both the MD5 and the CRC32 and combine them together in the format CRC32_MD5. The former is preferred.
Normalization function example (PHP):
trim(utf8_strtolower($email), " \t\r\n\0\x0B.");
The hash is a construct with the following format:
CRC32(normalized email) . '_' . MD5(normalized_email)
Atlas view tags are supported on ads targeting custom audiences, partner categories, and lookalike audiences.
Click tags from all approved providers are allowed with these targeting options and will continue to be allowed.