Create Your First Prospecting Campaign¶
Note
In this page we will use 0000000ADVERTISABLEEID
as an example of an advertisable EID. You should use an
advertisable from your organization as ownership privileges are enforced.
Create a campaign¶
The first step is creating your campaign. This is done by making a request to
POST /prospecting/api/v2/advertisables/(adv)/campaigns
:
curl -H 'Authorization: Token YOUR_TOKEN' \
-H "Content-Type: application/json" \
-d '{"name":"Example Campaign","weekly_budget":"30","currency_code":"USD"}' \
https://services.adroll.com/prospecting/api/v2/advertisables/0000000ADVERTISABLEEID/campaigns?apikey=MYAPIKEY
{
"results": {
"status": "active",
"created_at": "2017-02-13T15:32:57+00:00",
"advertisable": "0000000ADVERTISABLEEID",
"name": "Example Campaign",
"end_date": null,
"kpi_goal": null,
"weekly_budget": 30,
"is_active": true,
"updated_at": "2017-02-13T15:32:57+00:00",
"frequency_cap": null,
"source": "49er",
"admin_status": "active",
"eid": "0000000CAMPAIGNEID",
"adgroups": [],
"kpi_metric": null,
"start_date": "2017-02-13T15:32:57+00:00",
"currency_code": "USD"
}
}
Add AdGroups to your campaign¶
Now you’ll need to create the desired AdGroups for your campaign. This is done by making a request to
POST /prospecting/api/v2/campaigns/(campaign)/adgroups
:
curl -H 'Authorization: Token YOUR_TOKEN' \
-H "Content-Type: application/json" \
-d '{"name":"Example AdGroup","auto_audience":"true","auto_geo_targets":"true","ads":[{"ad":"0000000ADEID","is_active":"true","status":"active"}]}' \
https://services.adroll.com/prospecting/api/v2/campaigns/0000000CAMPAIGNEID/adgroups?apikey=MYAPIKEY
{
"results": {
"status": "active",
"campaign": "0000000CAMPAIGNEID",
"is_active": true,
"updated_at": "2017-02-13T15:42:28+00:00",
"auto_audience": true,
"ads": [
{
"status": "active",
"ad_eid": "0000000ADEID",
"is_active": true,
"eid": "0000000PROSPECTINGADEID"
}
],
"created_at": "2017-02-13T15:42:28+00:00",
"name": "Example AdGroup",
"audience": null,
"eid": "0000000ADGROUPEID",
"auto_geo_targets": false,
"geo_targets": [
{
"eid": "XSTN6R5HH5FJ5MAS5W8GEO",
"operation": "include"
}
]
}
}
Note
You must always send auto_geo_targets
as false
here, and send a list of geo_targets
that
can be queried using the Geotargeting API.
Add an audience to your AdGroups (Optional)¶
In the previous step, notice how we set auto_audience
to true
in the request to create the AdGroup. This means
that an audience of potential new customers will be created automatically for that AdGroup. However, if you wish to
specify a particular audience for an existing AdGroup, you can do that by making a request to
POST /prospecting/api/v2/adgroups/(adgroup)/audience
:
curl -H 'Authorization: Token YOUR_TOKEN' \
-H "Content-Type: application/json" \
-d '{"source_segment_eid":"0000000SOURCESEGMENTEID","size":200000}' \
https://services.adroll.com/prospecting/api/v2/adgroups/0000000ADGROUPEID/audience?apikey=MYAPIKEY
{
"results": {
"eid": "0000000AUDIENCEEID"
"adgroup_eid": "0000000ADGROUPEID",
"target_segment_eid": "0000000TARGETSEGMENTEID",
"source_segment_eid": "0000000SOURCESEGMENTEID",
"size": 200000,
"created_at": "2017-02-13T16:25:37+00:00",
"updated_at": "2017-02-13T16:25:37+00:00",
}
}
Add flights to your AdGroups (Optional)¶
Once your AdGroups are set, your campaign is ready to serve. By default, all AdGroups will serve their ads during the
same period of time determined by the campaign’s start and end date. However, you can specify time periods during which
an individual AdGroup should serve by creating flights. This is done by making a request to
POST /prospecting/api/v2/adgroups/(adgroup)/flights
:
curl -H 'Authorization: Token YOUR_TOKEN' \
-H "Content-Type: application/json" \
-d '{"start_date":"2017-02-15T00:00:00+00:00","end_date":"2017-02-20T00:00:00+00:00"}' \
https://services.adroll.com/prospecting/api/v2/adgroups/0000000ADGROUPEID/flights?apikey=MYAPIKEY
{
"results": {
"adgroup": "0000000ADGROUPEID",
"end_date": "2017-02-20T00:00:00+00:00",
"created_at": "2017-02-13T16:25:37+00:00",
"updated_at": "2017-02-13T16:25:37+00:00",
"eid": "0000000FLIGHTEID",
"start_date": "2017-02-15T00:00:00+00:00"
}
}