How to use Geographic Targeting with JSON API

This guide is an overview for implementing geotargeting via AdButler's JSON Ad API. For details on the geotargeting endpoints themselves, check our API documentation.

Geographic or location targeting (“geotargeting”) lets you serve ads only to viewers in certain locations, which AdButler infers from the viewer’s IP address. You can also do the opposite and exclude viewers in certain locations from being served. In most regions, you can target viewers down to the city level.

For example, you can use geotargeting to boost the visibility of ads about a new store opening in Los Angeles, California such that your ads will display only for people in Los Angeles. This way, the views and subsequent clicks will not be wasted on users who are not likely to visit the store.

Geotargeting can be used on its own or with other targeting methods to make your target audience as specific as needed.

You don’t need to configure anything to implement geotargeting when using zone tags. To implement it on server-side ad requests, use AdButler's JSON API.

Requesting via GET

Add the ip= query parameter and the IP address to be used for targeting into your GET request. The ip= query parameter supports both IPv4 and IPv6 addresses.

Example:

https://ads.domain.com/adserve/;ID=171230;size=300x250;setID=373469;type=json;ip=64.34.33.207;click=CLICK_MACRO_PLACEHOLDER
Query parameters should be added before ;click=CLICK_MACRO_PLACEHOLDER to make sure the request is read correctly. Everything after the ;click= parameter is read as one value. If you do not have a click tracking link, we recommend removing the ;click= parameter. Doing so will also make it easier to add or remove other parameters without affecting your ad's click-throughs.

Requesting via POST

You can also implement geotargeting via POST.

Example:

POST https://ads.domain.com/adserve
{
"ID": 171230,
"size" : "300x250",
"setID": 373469,
"type" : "json",
"ip": "64.34.33.207"
}

Can't find what you're looking for?

Send us an email

hello@adbutler.com

Visit the blog

For more ad serving tips, industry news and AdButler insights.