News for Developers

Back to News

Lead Ads + Offline Conversions

Fredrik Carlsen
December 18, 2016

Related News

Offer Ads API

February 09 2017

Developers Sandbox Mode

February 08 2017

Facebook Lead Ads are for advertisers who want to connect with potential customers. With Lead Ads, you can get accurate contact information from people that request something, such price estimates, newsletters, product demos, test drives and more. When someone clicks on an ad, they can submit a pre-populated form with information they already shared with Facebook. This makes it easy for people to sign up to hear more. The ad also has a mobile version, providing easy sign up on a mobile devices.

Measurement is important for all ads; with Facebook Pixel you can measure conversions on your website. However, in many lead generation scenarios, conversions happen offline: someone calls after a price estimate or goes to a car dealership to test drive after seeing an ad. The results of these campaigns are equally important, so we created the Offline Conversions API.

With this API you can signal conversations that happen in the real world, and can see how conversions map to your online campaigns. Offline conversions are especially useful for Lead Ads, where many conversions are offline, but you can also use it with any type of campaign when you want to measure offline results.

To measure your offline conversions for Lead Ads, create an offline event set:

curl -X POST \
-d 'name=Lead Offline Conversions' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/<BUSINESS_ID>/offline_conversion_data_sets

This returns the ID of the offline event set you created:

{"id": <OFFLINE_EVENT_SET_ID>}

Once you have an offline event set, make sure you associate it with your ad accounts that run lead ads:

curl -X POST \
-d 'account_id=<ACCOUNT_Id>' \
-d 'business=<BUSINESS_ID>' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/<OFFLINE_EVENT_SET_ID>/adaccounts

Returns success if call is successful.

{"success":true}

As with other types of tracking, you should add this event set to the ads' tracking specs :

curl -X POST \
-d 'tracking_specs=[{"action.type":"offline_conversion", "dataset": <OFFLINE_EVENT_SET_ID>}]' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/<AD_ID>

Returns success if call is successful.

{"success":true}

Now you can send us actual offline conversion data:

curl -X POST \
-d 'upload_tag=2016-10-28-conversions' \
-d 'data=[
      {"match_keys": {"email": ["<HASH1>", "<HASH2>"]}, "event_time":1477632399, "event_name": "Purchase", "currency": "USD", "value": 16.00},
      {"match_keys": {"email": ["<HASH3>", "<HASH4>"]}, "event_time":1477634162, "event_name": "Purchase", "currency": "USD", "value": 25.00}
   ]' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/<OFFLINE_EVENT_SET_ID>/events

Returns ID and number of matched entries if call is successful.

{"id":"<UPLOAD_ID>","num_processed_entries":<COUNT>}

Also see Offline Conversions, Developer Guide.

So it is easy for you to create audience from the offline conversions, create audience directly from your offline event set:

curl -X POST \
-d 'name=30d lead converters' \
-d 'subtype=OFFLINE_CONVERSION' \
-d 'retention_days=30' \
-d 'rule={"event":{"eq":"Purchase"}}' \
-d 'dataset_id=<OFFLINE_EVENT_SET_ID>' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/act_<AD_ACCOUNT_ID>/customaudiences

Returns audience ID if call is successful.

{"id":"<AUDIENCE_ID>"}

In this example, we create a new audience based on people who made purchases in the past 30 days. You can use this new audience for retargeting, excluding, or creating Lookalike audiences to find new customers. See Custom Audiences from Offline Conversions.


Related News

February 09 2017

February 08 2017

December 22 2016

November 16 2016

November 09 2016