For the complete documentation index, see llms.txt. This page is also available as Markdown.

GEO headers

Use the location data (country, region, city, IP address and postal code) that AdPage automatically adds to every incoming request in your GTM server container.

What are GEO headers?

Need better location information for advanced server-side logic? Use the GEO headers. AdPage server-side tagging automatically adds geographic information about the visitor as headers to every incoming request. This lets you identify where a visitor is accessing your site from, without relying on separate APIs or external services.

The following headers are added to the Incoming HTTP Request in your GTM server container:

Header
Contains

X-Geo-Country

The visitor's country

X-Geo-Region

The visitor's region

X-Geo-City

The visitor's city

X-Geo-Ipaddress

The visitor's IP address

X-Geo-PostalCode

The visitor's postal code

The values are looked up in a geolocation database based on the visitor's IP address and added to the headers.

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.

Why use GEO headers?

  • Location-specific targeting — recognise a user's country, region or city to enable more precise targeting and segmentation.

  • Region-specific settings and consent — privacy rules (such as GDPR) differ per region, so adjusting tracking behaviour based on a user's location can be crucial. GEO headers help you collect user data in a lawful, compliant way without introducing an overly complex configuration.

  • Seamless integration with sGTM — because the headers are added at server level, you don't need separate scripts or API calls to get location data.

Do I need to set anything up?

No. The GEO headers are available automatically and are sent along with every request to your server container.

Using GEO headers in your tags

To use the location data in specific tags, create a Request Header variable in your GTM server container.

1

Create a new variable

In your GTM server container, go to Variables and click New under User-Defined Variables.

2

Choose Request Header

Select Request Header as the variable type and enter the header you need as the Header Name, for example X-Geo-Country.

3

Save and use the variable

Give the variable a clear name (for example Request Header - X-Geo-Country), save it, and use it in your tags, triggers or other variables wherever you need the location data.

Repeat this for each GEO header you want to use.

Last updated

Was this helpful?