Universal Campaigns API Examples

Create a Universal Campaign

Create a Universal Campaign that can serve both web retargeting and Facebook ads. This campaign will not have any ads or AdGroups yet. Those can be included in the request to set up the campaign via the adgroups parameter, or created separately (see below). A Universal Campaign governs the budget, which is shared among its AdGroups. See also CampaignCreate

curl -H 'Authorization: Token YOUR_TOKEN' \
    -H "Content-Type: application/json" \
    -d ' { "advertisable_eid": "MY_ADVERTISABLE_EID", "name": "My First Campaign", "budget_settings": { "budget_type": "daily", "goal": 200.00, } }' \
    "https://services.adroll.com/activate/api/v2/campaign?apikey=MYAPIKEY&advertisable_eid=MY_ADVERTISABLE_EID"
{
  "data": [
    {
      "advertisable_eid": "MY_ADVERTISABLE_EID",
      "budget": 1000.0,
      "created_at": "2017-03-13T23:08:33.198960",
      "currency": "USD",
      "end_date": null,
      "start_date": "2017-03-13T23:08:33.184906",
      "status": "live",
      "strategy_eid": "MY_UNI_CAMPAIGN_EID"
    }
  ]
}

Create a Universal AdGroup

Create an AdGroup as part of an existing Universal Campaign. The Universal AdGroup is where you specify start and end dates, KPI goal and metric, a set of ads, and targeting parameters. In order to create a new AdGroup within a campaign, the Universal Campaign must have a budget of at least 5 * ([number of current AdGroups] + [number of AdGroups being created]) (in USD), otherwise the AdGroup will be rejected. AdGroups should only contain either all static or all dynamic ads, and the ad types should match the value of the ad_type parameter. See also AdGroupCreate

curl -H 'Authorization: Token YOUR_TOKEN' \
    -H "Content-Type: application/json" \
    -d '{ "ad_type": "static", "ads": [{"eid": STATIC_AD_EID, "status": "live"}],  "name": "My Adgroup", "kpi_metric": "CPC", "kpi_goal": 3}' \
    "https://services.adroll.com/activate/api/v2/adgroup?apikey=MYAPIKEY&campaign_eid=MY_UNI_CAMPAIGN_EID"
{
  "data": {
    "ad_type": "static",
    "ads": [{"eid": "STATIC_AD_EID", "status": "live"}],
    "campaign_eid": "MY_UNI_CAMPAIGN_EID",
    "created_at": "2017-03-13T23:08:33.198960",
    "eid": "NEW_ADGROUP_EID",
    "email": null,
    "kpi_goal": 3.0,
    "kpi_metric": "CPC",
    "name": "My Adgroup",
    "start_date": "2017-03-13T23:08:33.184906",
    "end_date": null,
    "status": "live",
    "targeting_features": {
      "geotargets": [],
      "negative_segment_eids": [],
      "positive_segment_eids": []
    }
  }
}

Fetch a Universal Campaign

curl -H 'Authorization: Token YOUR_TOKEN' \
    "https://services.adroll.com/activate/api/v2/campaign?apikey=MYAPIKEY&advertisable_eid=MY_ADVERTISABLE_EID&eid=MY_UNI_CAMPAIGN_EID"
{
  "data": [
    {
      "advertisable_eid": "MY_ADVERTISABLE_EID",
      "budget": 1000.0,
      "created_at": "2017-03-13T23:08:33.198960",
      "currency": "USD",
      "end_date": null,
      "start_date": "2017-03-13T23:08:33.184906",
      "status": "live",
      "strategy_eid": "MY_UNI_CAMPAIGN_EID"
    }
  ]
}