This document illustrates how to create Homepage ads via our Ads API using your Self-serve account.
Please follow the steps given below to create Homepage Ads using the Ads API.
Make sure your Ads account is part of the Homepage Ads beta otherwise you will be unable to complete the following steps.
A country rate card is its CPM cost in our system, each rate is expressed in cents in that currency.
Request
curl "https://graph.facebook.com/act_XXXXXXX/ratecard?access_token=access_token"
Sample Response (Note: These values are for example only, actual values may be different)
{
"data": [{
"country": "US",
"currency": "USD",
"rate": 900
},
{
"country": "CA",
"currency": "CAD",
"rate": 750
},
{
"country": "GB",
"currency": "GBP",
"rate": 530
},
...
]
}
The following parameters are mandatory to create a Homepage Campaign:
Note The campaign CPM (lifetime_buget / lifetime_imps) should match at least one of the countries currency rate card you’re using. A country rate card is its CPM cost in our system (To find out rate cards for countries please refer to step 1). If the campaign CPM does not match the country rate card, it is likely that the Ad will not run.
Request
curl -F name="Homepage Campaign Testing" \
-F lifetime_budget=50000 \
-F lifetime_imps=5000 \
-F start_time=1337712317 \
-F end_time=1337798717 \
-F campaign_status=2 \
"https://graph.facebook.com/act_XXXXXXX/adcampaigns?access_token=access_token"
Sample Response
{"id":"6004467942302"}
Create a Homepage Ad Group
A Homepage campaign should contain one or more Homepage Ad Group(s), it cannot contain a regular ad group.
The following parameters are mandatory to create a Homepage Ad Group:
Request
curl -F campaign_id=6004467942302 \
-F bid_type=5 \
-F "bid_info={'1':20,'38':40,'44':40}" \
-F locations=[4] \
-F "creative={\
'type':12,\
'title': 'Homepage Ad Example',\
'body': 'This is the body of a Homepage Ad.'\
'link_url': 'http://example.com/',\
'image_url': 'http://example.com/images/banner.jpg'\
}" \
-F "targeting={'countries':['US']}" \
-F name="Homepage Adgroup Test"\
"https://graph.facebook.com/act_XXXXXXX/adgroups?access_token=access_token"
Sample Response
{"id":"6004469964102"}