Skip to main content
Geotargeting

Managing zip, state, dma targeting

OddBytes avatar
Written by OddBytes
Updated over 2 years ago

Existing targeting list in account, campaign and creative level

Account level targeting list

GET Method

curl -u username:password -c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting?itemLevel=accounts"

JSON Response

{
"success": true,
"data": [{
"account_id": "1744",
"region_id": "405",
"region_name": "California",
"region_code": "CA",
"targeting": "INCLUDED",
"region_type": "STATE"
}
],
"total": 1
}

Campaign level targeting list

GET Method

curl -u username:password -c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting?itemLevel=campaigns"

Creative level targeting list

GET Method

curl -u username:password -c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting?itemLevel=creatives"

Limit the number of results in the response with a limit parameter

GET Method

curl -u username:password -c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting?itemLevel=campaigns&limit=10"

Filter results by creative or campaign by sending its ID

GET Method

curl -u username:password -c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting?itemLevel=campaigns&itemId=664115"

JSON Response

{
"success": true,
"data": [{
"account_id": "1744",
"campaign_id": "664115",
"campaign_name": "Test CPA 2",
"region_id": "450",
"region_name": "Texas",
"region_code": "TX",
"targeting": "EXCLUDED",
"region_type": "STATE"
}
],
"total": 1
}

Adding targeting on an account, campaign or creative level

Parameters:

  • itemID - accountId, campaignId or creativeId

  • itemLevel - account, campaign or creative

  • targeting - INCLUDED or EXCLUDED

  • actionType - APPEND or OVERRIDE

  • targetingRegions - a list(s) of States, DMAs or ZIPs

POST Method

curl -u username:password -X POST \
--data '{"itemId":"1744","itemLevel":"accounts", "targeting":"EXCLUDED","actionType":"OVERRIDE","targetingRegions":[{"ZIP":["90210"]}]}' \
-c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting"

Removing targeting

Parameters:

  • itemID - accountId, campaignId or creativeId

  • itemLevel - account, campaign or creative

  • regionID - state, zip or DMA id. If you want to remove all you should set "0" here

  • regionType - "STATE", "DMA" or "ZIP"

  • removeAll - true or false depending on do you want to remove all or not

DELETE Method

curl -u username:password -X DELETE \
--data '{"itemId":"1744","itemLevel":"accounts","regionId":"90210", "regionType":"ZIP"}' \
-c cf.log -b cf.log \
"http://platform.oddbytes.com/api/v1/1744/geoTargeting"

Following example will remove all ZIPS from campaign 12345 on account 4321

curl -u username:password -X DELETE \
--data '{"itemId":"12345","itemLevel":"campaigns","regionId":"0", "regionType":"ZIP", "removeAll":true}' \
-c cf.log -b cf.log \
"https://platform.oddbytes.com/api/v1/4321/geoTargeting"

Did this answer your question?