Key-values
URL macros in image and click URLs
If you are using the GAM Email AdServer product, you can use one of the existing supported key-values for targeting purposes, or add your own.
Key-value configuration in GAMPlease make sure to configure the key-values you want to use in the โKey-valuesโ section under the Inventory tab in GAM in order use them for targeting or reporting in your line items.
Default key-values
The following key-values are automatically passed through to GAM. The values are passed in lowercase.
๐ Geo-targeting
Key-value | Description |
---|---|
| The country code in ISO 3166-1 alpha-2 form. This can be used to target a line item to one or more countries. For example, you can target to a line item only if the traffic is from |
| The region code in ISO 3166-2 form. Each ISO 3166-2 code consists of two parts, separated by a hyphen:
|
| The name of the city. For example, if you want to target a line item to only traffic from Paris, you would target to the key You can find the list of city names via https://www.geonames.org/ |
| The postal code |
| The Nielsen DMA code. For example, if you want to target a line item based to traffic from the Boston / Manchester region, you would target the key |
๐ฏ Proxy targeting
Key-value | Description |
---|---|
| Set to Gmail uses an image proxy and this will be set to true when the ad impression is from Gmail, as well as for Yahoo, Outlook and Apple Proxy. |
| The name of the proxy when The value will be one of:
|
Limitations for proxy trafficFor Proxy traffic, the following fields will not be set as the data is of unknown accuracy:
pi_geo_regioncode
pi_geo_city
pi_geo_postalcode
pi_geo_metrocode
pi_geo_country
will be set but may be inaccurate depending on the on the proxy.
Custom key-values
We support two types of key-value targeting in Google Ad Manager (GAM): static (backend-applied) and dynamic (front-end passed via URL). Understanding the difference is critical for proper targeting and troubleshooting.
1. Static Key-Values (Backend-Defined)
These are applied during ad setup on our side and are not passed via the URL.
- Commonly used for fixed attributes like
position
oenewsletter
(e.g.,pos=1
,pos=2
, etc.) - These key-values become part of the ad request
- Use these in GAM for precise targeting where the values do not change between requests
- Example:
- Ad slot "Top Banner" is always
pos=1
- GAM can target
pos=1
for premium sponsorships
- Ad slot "Top Banner" is always
Note: You cannot modify static key-values through your image or click URLs. They must be coordinated with your account manager.
2. Dynamic Key-Values (Front-End via URL)
These are custom values passed via query parameters in the ad image and click URLs, using the dfp_
prefix.
- Common for attributes like day of week or campaign ID
- These values are extracted directly from the ad request URL
- Useful for passing contextual targeting values at runtime
How to Pass a Dynamic Key-Value
- Add a query parameter to the image and click URL with the prefix
dfp_
- In GAM, target the key without the
dfp_
prefix
Key-value configuration in GAMThe
dfp_
prefix is stripped off when passing the key-value. On the GAM side, you must use the name of the key without that prefix i.e if the query parameter isdfp_<key>
, the key-value to configure in GAM will be<key>
without the prefix.
Example
To target a day of the week:
- Attached to URL:
dfp_dayofweek=<value>
(for examplesunday
) - In GAM:
Target key:dayofweek
Target value:sunday
Summary Table
Type | How it's Applied | Example Key | Editable by Publisher | Use Case |
---|---|---|---|---|
Static | Server-side / Backend | pos | No | Fixed slot targeting |
Dynamic | URL query param (dfp_*) | dayofweek | Yes | Contextual targeting |
Reporting
In order for the key-values to appear in reports, they must be marked as reportable.
Under Inventory / Key-values, edit the key-values you want to make reportable and select "Dynamic" and "Include values in reporting".

When running reports, you can add the Key-values dimension under Inventory

You can also optionally filter to a specific key-value

Custom reporting dimensions
If you want to use a specific key value as a custom dimension in reports, it needs to be pre-defined. Note that there is a limit of 200 values per key and this also counts against the total values limit in your account. Below are preset values for some of our key-values to help you set up your account.
Data set | Information |
---|---|
This data set is too large to use for the | |
This data set is an optimized country list with the maximum of 200 entries, with a subset of countries excluded based on population, GDP and geographical area. Depending on your audience, you may want to adjust the selection, using the full list as a starting point. | |
The list of 4 recognized proxy types |

Example of pre-defined values for proxy types
Updated 3 days ago