Custom Audience in facebook helps to target the audience which they have already established the relation either on Facebook or on other digital platforms, It is more advanced then Google remarketing however it has niche targeted audiences
The following are the various ways to create custom Audience in Facebook advertising
Custom Audiences API Integration steps given below
The response will be:
To specify the list of people you want to add to your custom audience, use the endpoint
Possible values for
If the addition of the person succeeds, the API call will return
Oct 1st Breaking Change Notice: The response will contain the following fields:
The response will be
To update the list of people in the audience, you should add additional people or delete.
You may also share audiences between ad accounts. To do so, make an HTTP POST to the follow endpoint
You can also delete an ad account by specifying an HTTP DELETE to the same endpoint with the
To do so, specify a
To opt-out a person from audience after they have clicked through to your opt-out URL, make an HTTP DELETE call to
Before hashing the data make sure to normalize all the email addresses and phone numbers
For example, the hash function in PHP converts the normalized email and phone number as follows
The following are the various ways to create custom Audience in Facebook advertising
Here I am pleasure to explain the process step by step .
a) Data file Costume Audience
This option allows you to Upload a CSV file with detail instruction of
the Audience which you want to target. These are some information you
will have to put into the CSV.
Such As
- Email address
- Facebook User ID
- Phone number
- Mobile advertiser ID (such as Android or Apple user ID)
Once when you uploaded the file, it will
take about 1 hr. to process and find the matches from its users. Min.
100 User record facebook recommended. Otherwise the audience is likely
to be too small to have any kind of impact or reach. after processing,
you'll see that the audience you've just created will be available to
advertise to when you create a new ad:
From here, you can just create an ad as normal but it will be targeted just at this list of people.
Custom Audiences API Integration steps given below
Create
To create a custom audience you'll first need to create a blank audience. The endpoint to create an audience is https://graph.facebook.com/act_adaccountid/customaudiences
and it takes the following fields:name | type | description | required |
---|---|---|---|
name | string | name of your custom audience | yes |
description | string | description of your custom audience | no |
opt_out_link | string | Your opt-out URL so people can choose not to be targeted | no |
name | type | description |
---|---|---|
id | integer | ID of custom audience |
You can create a maximum of 500 custom audiences.
Add people to audiences
Then, you'll want to add people to the blank audience you just created. People can be added to audiences using either a hash of an Email Address, their Facebook ID, their Phone Number, their App User ID, Apple's Advertising Identifier (IDFA), or their Android advertising ID.
Oct 1st Breaking Change Notice:
Migration name: Custom Audience New Upload API
Adding/removing users from Custom Audiences will have a simpler upload format.
The
MD5 hashing will no longer be supported. For hashing fields, use SHA-256.
There are changes to the schema names when specifying the type of data. custom_audience_third_party_id is deprecated in favor of mobile_advertiser_id.
The response will contain details of the request instead of returning
Migration applies to GET, POST, DELETE
Migration name: Custom Audience New Upload API
Adding/removing users from Custom Audiences will have a simpler upload format.
The
users
field from the https://graph.facebook.com/{audience_id}/users
endpoint will be deprecated in favor of payload
. Details of the payload field provided in Adding People to Audiences.MD5 hashing will no longer be supported. For hashing fields, use SHA-256.
There are changes to the schema names when specifying the type of data. custom_audience_third_party_id is deprecated in favor of mobile_advertiser_id.
The response will contain details of the request instead of returning
true
.Migration applies to GET, POST, DELETE
https://graph.facebook.com/{audience_id}/users
https://graph.facebook.com/{audience_id}/users
with the following parameters:name | type | description | required |
---|---|---|---|
Oct 1st Breaking Change Notice: This field will be removed | JSON Array | List
of people defined by email, phone number, FBID, app user ID, Apple's
Advertising Identifier (IDFA), or Android's advertising ID. e.g. users=[{"email_hash":"HASH"}, {"email_hash":"HASH"}, {"email_hash":"HASH"} …] | Yes |
payload Oct 1st Breaking Change Notice: new field | JSON Object | Two fields: schema , data . e.g.payload = { "schema":"EMAIL_SHA256", "data":["HASH", "HASH", "HASH" ]} | Yes |
schema | string | type of hashing to use: md5 or sha256 | only if using sha256 |
schema
of each way of specifying a personKey (old -> new as of Oct 1st) | Description |
---|---|
Upload people based on their Facebook ID | |
Upload people based on the hash of their email address. Hashing method must be SHA-256 | |
Upload people based on the hash of their phone number. Hashing method must be SHA-256 | |
deprecated use MOBILE_ADVERTISER_ID instead. | |
MOBILE_ADVERTISER_ID | Upload people based on the app user ID, Apple's Advertising Identifier (IDFA), or Android's advertising ID. |
There
is no max on the total number of people that can be added to an
audience, but up to 10000 people can be added at a given time.
true
.Oct 1st Breaking Change Notice: The response will contain the following fields:
name | type | description |
---|---|---|
audience_id | int | Audience identifier |
num_received | int | Total number of users received |
num_invalid_entries | int | Total number of users with invalid format or unable to decode. |
invalid_entry_samples | JSON string Array | Up to 100 samples of invalid entries. |
It may take up to 1 hour before the people are added to the audience.
Read
By ad account
To retrieve information about the custom audiences your ad account has, make an HTTP GET call to https://graph.facebook.com/act_adaccountid/customaudiences?fields=<comma_separate_list_of_fields?
with the fields you wish to retrieve. Only id
will
returned by default once the "New Graph API framework conversion"
migration is enabled. Otherwise, the response will be an array of the
following fields:
Oct 1st Breaking Change Notice: New Graph API framework conversion
Migration name: Migrate Ads API endpoints to new Graph API framework for Q4 2014
Removal of following fields:
Changes to following fields:
Migration name: Migrate Ads API endpoints to new Graph API framework for Q4 2014
Removal of following fields:
parent_audience_id
parent_category
status
, usedelivery_status
oroperation_status
type
type_name
null
or a single value, so are being removed for simplicity.Changes to following fields:
account_id
type change from int to numeric string IDid
type change from int to numeric string ID
Name | Description | Type |
---|---|---|
id | The ID of this custom audience | Oct 1st Breaking Change Notice: response value will be a numeric string ID |
account_id | The ID of ad account which this audience belongs to | Oct 1st Breaking Change Notice: response value will be a numeric string ID |
approximate_count | Approximate number of people in this audience | int |
Oct 1st Breaking Change Notice: new field data_source | JSON dictionary of type , sub_type , creation_params to indicate by which method the custom audience was created | JSON dictionary |
Oct 1st Breaking Change Notice: new field delivery_status | JSON dictionary of code and description .
Indicates whether or not an audience can be used in ads. There are two
situations that an
audience will make ads not deliverable. First, if the size is smaller
than 20 people, the audience can’t be delivered. Second, if for some
reason the audience is disabled (such as violation of policy, expired),
validation will fail when it is used in ads. | JSON dictionary |
lookalike_audience_ids | The IDs of the lookalike audiences generated from this audience | array |
lookalike_spec | Generated only when the subtype is LOOKALIKE . More info at Lookalike Audience | array |
name | The name of this audience | string |
Oct 1st Breaking Change Notice: This field will be removed | Parent audience ID | long |
Oct 1st Breaking Change Notice: This field will be removed | Type of the parent audience whether it is custom audience (e.g. Custom), partner category (e.g. Acxiom) or broad category (e.g. Activities) | string |
Oct 1st Breaking Change Notice: new field permission_for_actions | JSON dictionary of permissions (string) to boolean value if the custom audience has that permission | JSON dictionary |
Oct 1st Breaking Change Notice: new field operation_status | JSON dictionary of code to int value and description
to a description string. The operation status represents the status of
the last operation performed on an audience. In general, it will have
following states:
| JSON dictionary |
Oct 1st Breaking Change Notice: This field will be removed | Current status of the audience (e.g. ready, waiting, error) | string |
subtype | Subtype of the custom audience: CUSTOM - custom audience LOOKALIKE - lookalike audience WEBSITE - custom audience from your website APP - custom audience from your app MANAGED - managed custom audience PARTNER - partner category other audience types returned are from custom audiences created in our interfaces | string |
Oct 1st Breaking Change Notice: This field will be removed | Audience type (e.g. 4->custom audience, 6->broad categories) | string |
Oct 1st Breaking Change Notice: This field will be removed | Name of the audience type (e.g. Advertiser generated->custom audience, BCT->broad categories) | string |
time_updated | Last time this audience was updated | long |
By Custom Audience
To retrieve information about a particular custom audience, make an HTTP GET call to https://graph.facebook.com/{audience_id}?fields=<comma_separate_list_of_fields?
with the fields you wish to retrieve. Only id
is
returned by default once the "New Graph API framework conversion"
migration is enabled. The response will be the same as when querying by
ad account.Update
To update the audience name, make an HTTP POST call to https://graph.facebook.com/{audienceid}
with the following fields:name | type | description |
---|---|---|
name | string | new name of the audience |
description | string | new description of the audience |
opt_out_link | string | Your opt-out URL so people can choose not to be targeted |
true
if successful.To update the list of people in the audience, you should add additional people or delete.
Delete
Deleting an Audience
To delete an Audience make an HTTP DELETE call tohttps://graph.facebook.com/{audience_id}
with the fieldname | type | description | required |
---|---|---|---|
force_delete_lookalikes | bool | Force deletion of lookalikes derived from the custom audience | No |
Deleting people from an Audience
To delete people from a custom audience make an HTTP DELETE call to https://graph.facebook.com/{audience_id}/users
with the same fields as Adding People to Audiences.Sharing audiences
Sharing audiences is a restricted feature. Please contact your account manager for access.
https://graph.facebook.com/{audienceid}/adaccounts
with the following field:name | description | example | required |
---|---|---|---|
adaccounts | Array of new ad account ID's to receive access to the custom audience | adaccounts=[1234, 2222] | yes |
adaccounts
field set to the ad account you want to remove access.
The destination account cannot modify the audience or use it as a seed audience to create lookalikes.
Using Custom Audiences in Targeting
Custom Audiences can be used alongside existing Broad Categories and can also take advantage of conjunctive AND targeting.To do so, specify a
custom_audiences
field in your targeting spec.targeting:{
'countries':['US'],
'user_adclusters':[{'id':6002714885172,'name':'Cooking'}],
'custom_audiences':[{'id':6004192254512,'name':'customaudience'}]}
Exclusion Targeting
Advertisers can exclude a custom targeting audience from seeing an Ad or Sponsored Story by specifying anexcluded_custom_audiences
field in their targeting spec: targeting:{
"countries":["US"],
"age_min":25,
"age_max":40,
"excluded_custom_audiences":
[{"id":"6004192254512","name":"customaudience"}],
}
Opt-out
If a person has opted out of being targeted, you must remove the person from all custom audiences containing this person. To do so, you can send us the person and Facebook will delete them from all audiences that you own so that you don't have to remember which audience this person is a part of.To opt-out a person from audience after they have clicked through to your opt-out URL, make an HTTP DELETE call to
https://graph.facebook.com/act_{ad_account_id}/usersofanyaudience
with the same fields as Adding People to Audiences
This will remove the people you specify from ALL custom audiences belonging to the specified ad_account_id.
Hashing
Oct 1st Breaking Change Notice: The accepted method for hashing is SHA256. MD5 hashing will no longer be supported.Before hashing the data make sure to normalize all the email addresses and phone numbers
- Normalize Email addresses by trimming leading and trailing whitespace, and convert all characters to
trim(strtolower($email), " \t\r\n\0\x0B.");
- Normalize phone numbers by removing any symbols, letters, and any leading zeroes.
SHA256 examples
Compute the SHA256 value for the normalized email address or phone number and use the hex representation of this value (using lowercase for A through F).For example, the hash function in PHP converts the normalized email and phone number as follows
example | result |
---|---|
hash("sha256", "mary@example.com") | f1904cf1a9d73a55fa5de0ac823c4403ded71afd4c3248d00bdcd0866552bb79 |
hash("sha256", "15559876543") | 1ef970831d7963307784fa8688e8fce101a15685d62aa765fed23f3a2c576a4e |
Measurement
Atlas View Tags
Atlas view tags are supported on ads targeting custom audiences, partner categories, and lookalike audiences.- View tags from all approved providers are still allowed with exclusion targeting of custom audiences or lookalikes.
- Other view tag providers are still blocked from adding view tags to ads targeting custom audiences, partner categories, and lookalike audiences.
Click Tags
Click tags from all approved providers are allowed with these targeting options.Terms of Service
An advertiser must accept Custom Audience's terms of service in order to use the product. You can query which terms a given account accepted by checking the fieldtos_accepted
of a given ad account. You can find more information at the ad account documentation.Examples
Creating and adding people to a custom audience// Create blank audience
curl \
-F "name=testAudience" \
-F "access_token=______" \
"https://graph.facebook.com/act_12345678/customaudiences"
// Add people
curl \
-F 'payload = { \
"schema":"EMAIL_SHA256", \
"data":["HASH", "HASH", "HASH"]}' \
-F "access_token=_____" \
"https://graph.facebook.com/6005123456/users"
To update the audience namecurl \
-F "name=testAudience" \
-F "access_token=___" \
https://graph.facebook.com/{audienceid}
To update the audience descriptioncurl \
-F "description=testAudience new description" \
-F "access_token=___" \
https://graph.facebook.com/{audienceid}
Deleting people from a custom audience// Deleting people
curl \
-X DELETE \
-F 'payload = { \
"schema":"EMAIL_SHA256", \
"data":["HASH", "HASH", "HASH"]}' \
-F "access_token=_____" \
"https://graph.facebook.com/<audienceid>/users"
To edit Opt-out linkcurl \
-F "opt_out_link=http://www.yourdomain.com/optout" \
-F "access_token=___" \
https://graph.facebook.com/<audienceid>
0 Comments