Custom Audiences from Offline Conversions

Group people who visited your store, made calls to your customer service, or took action offline and target them with Facebook ads. For example, to target people who spent more than $1000 in the past 90 days:

curl \
-F 'name=90d High Value' \
-F 'subtype=OFFLINE_CONVERSION' \
-F 'retention_days=90' \
-F 'rule={"event":{"eq":"Purchase"}}' \
-F 'rule_aggregation={"type":"sum", "config":{"field":"value"},"operator":">","value":"1000"} ' \
-F 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences"

Custom Audiences from Offline Conversions are based on conversion events uploaded to an Offline Event Set. See Offline Conversions API documentation.

Creating Audiences

First you should accept the Terms of Service for Custom Audiences in Power Editor. To create a custom audience from your event set:

curl \
-F 'name=30d Purchasers' \
-F 'subtype=OFFLINE_CONVERSION' \
-F 'retention_days=30' \
-F 'rule={"event":{"eq":"Purchase"}}' \
-F 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences"

Use these parameters:

Name Description Type Required

name

Name for audience

String

Yes

subtype

Must be set to OFFLINE_CONVERSION

String

Yes

rule

Audience rules applied to Offline Event

String

No.


Defaults to all people you uploaded events for

retention_days

Number of days to keep person in audience. Between 1 and 180 days

Int

Yes

dataset_id

Offline Event Set associated with this audience

Int

Yes

rule_aggregation

Aggregate function. See below

JSON-encoded String

No

Audience Rules

Rules determine whether a person should be added to this audience. They apply to Offline Events sent through the Offline Conversions API or uploaded manually with Offline Event Manager.

For example, build an audience with people who purchased in the past 30 days:

curl \
-F 'name=30d Purchasers' \
-F 'subtype=OFFLINE_CONVERSION' \
-F 'retention_days=30' \
-F 'rule={"event":{"eq":"Purchase"}}' \
-F 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences"

Rules can use Offline Event attributes in custom_data field called 'category'. This targets people who purchased a product from the footwear category in the past 60 days:

curl \
-F 'name=60d Footwear Purchasers' \
-F 'subtype=OFFLINE_CONVERSION' \
-F 'retention_days=60' \
-F 'rule={"and": [{"event":{"eq":"Purchase"}},{"custom_data.category":{"i_contains":"FOOTWEAR"}}]}' \
-F 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences"

Rules are based on these operators and data types:

Name Description

operator

  • i_contains - Contains substring, case insensitive
  • i_not_contains - Does not contain substring, case insensitive
  • contains - Contains substring, case sensitive
  • not_contains - Does not contain substring, case sensitive
  • eq - Equal to, case sensitive
  • neq - Not equal to, case sensitive
  • lt - Less than, numeric fields only
  • lte - Less than or equal to, numeric fields only
  • gt - Greater than, numeric fields only
  • gte - Greater than or equal to, numeric fields only
  • regex_match -
    Matches a regular expression, such as ".*shoes". Full PCRE grammar supported

data

  • event - Offline Event name. Examples: 'Purchase', 'Lead', 'Other'
  • value - Offline Event value
  • custom_data - Any attribute added to custom_data for an Offline Event. Examples: custom_data.category, custom_data.color.

Aggregate Functions

Create custom audiences based upon the frequency and intensity of a person's behavior through a rule_aggregation field. Provide functions with these fields:

Name Description

type

Type of function: count, sum, avg, max, min

config

Required by certain aggregation functions. See below

operator

  • =
  • >
  • >=
  • <
  • <=
  • !=
  • @> - Time between delivery and when the Offline Event took place is longer than the value, or now - pass-in-time > value
  • @< - Time between delivery when the Offline Event took place is shorter than the value, or now - pass-in-time < value

value

Integer. rule_aggregation value

The available functions are:

NameRequired ConfigDescription

count

Number of Offline Events satisfying the rule

sum

{“field”: “field_name”}

Accumulate values of given Offline Event's field

avg

{“field”: “field_name”}

Average of values in specified Offline Event's field

max

{“field”: “field_name”}

Maximum value for a Offline Event's field

min

{“field”: “field_name”}

Minimum value in a Offline Event's field

To target people who purchased more than 5 times in the past 110 days:

curl \
-F 'name=110d Returning Customers' \
-F 'subtype=OFFLINE_CONVERSION' \
-F 'retention_days=110' \
-F 'rule={"event":{"eq":"Purchase"}}' \
-F 'rule_aggregation={"type":"count", "operator":">", "value": "5"} ' \
-F 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customaudiences"

Best Practices

  • Experiment with different audiences, for example, people who purchased frequently in the past that did not return recently or people who purchased only from one category
  • Create Lookalike audiences based on audiences that perform the best