About key-values

Target key-values

Apply custom targeting in the targeting picker

You can use custom targeting in line items or other places in Ad Manager. Find custom targeting under the "Custom targeting" section of the targeting picker. Custom targeting includes key-valuesaudience segments, or content metadata (for Video Solutions publishers).

The targeting picker is available across Ad Manager in line items, proposal line items, and rules that help you protect your brand and manage inventory for your indirect sold campaigns.

Match types

The "match types" and advanced expressions below describe how to target variations of key-values. Match types only apply to dynamic key-values and are not supported by predefined key-values.

  • Exact match

    If you don't add any special modifiers to a targeted value, the user search must match it exactly. For example, if you target travel, travelers and travels don't match. Private Auction deals support exact-match key values only  when using custom targeting.

  • "Begins with" match

    Use an asterisk (*) at the end of a value to match items that begin with the value but have additional characters at the end. For example, travel* would match values like traveler and traveling, as well as travel the world, because these terms begin with travel. It would not match terms such as where to travel or fasttravel.

  • "Include" match

    Use a tilde (~) at the beginning of a value to include values that have the entire word in them, in any location. For example, ~travel would match values like adventure travel and travel insurance, but not travelers or travelers insurance.

  • "Begins with" and "include" match

    Now we're getting fancy. You can use both a tilde and an asterisk on a value: ~travel*. The "begins with" part of the value can now appear anywhere in the value, not just at the beginning. Our example would match travelers, luxury travelers, travel insurance, traveling penalty, but not re-travel.

  • Values with spaces

    When you're using match types, spaces are treated as characters within the value. For example, travel deal* would match travel deals and travel dealership, but not traveling deal.

Examples of match types

The following tables give more examples of different match types. For each value on the left, you can see whether a series of search terms are considered matches. Terms that don't match are crossed out.

Single-word values

Match type Value Does the search term match?
Exact match car car car parts cartoon used car Madagascar
Begins with car* car car parts cartoon used car Madagascar
Include ~car car car parts cartoon used car Madagascar
Begins/include ~car* car car parts cartoon used car Madagascar

The following table gives examples of different match types for multi-word values.

Multi-word values

Match type Value Does the search term match?
Exact match new car new car new car buy new car new car smell new cartoon
Begins with new car* new car new car buy new car new car smell new cartoon
Include ~new car new car new car buy new car new car smell new cartoon
Begins/include ~new car* new car new car buy new car new car smell new cartoon

These match types can also be applied to key-values that aren't search terms.

In addition to using these match types for search terms and key-values that are dynamically passed to the ad tag (like demographic information about a user), you can use them in key-values that are hard-coded in the ad tag (like information about the content of the page).

For example, let's say you have a car website and you've made key-values for the make and model of cars that you feature on the site. You may have a key-value for car=hondacivic that is hard-coded in the ad tags on the pages of your site that discuss the Honda Civic. You may also have key-values for car=hondaaccord and car=hondainsight. If you want to target all the pages of your site that discuss Hondas, you could target a line item to car=honda* and that line item would show to any key-value that has a value that begins with the word honda.

The above example is of a "begins with" match, but you can also use other match types to target key-values that aren't search terms.

Advanced expressions targeting

Only available in Google Ad Manager 360.

Advanced expressions targeting allows you to enter key-valuesaudience segments, or content metadata as text. Your organization may already have a resource where sets of entries can be copied and pasted. Advanced expressions targeting can be useful if you have a large set of expressions to enter.

 Enter an advanced expression

  1. Navigate to the details page of the line item or proposal line item.
  2. Scroll down to the "Targeting" section.
  3. Click Custom targeting to expand this section of targeting. If it's not visible, click Show more to display all targeting types.
  4. Click Add advanced expression.
  5. Enter the advanced expression. Follow good practice in advanced expression syntax
  6. Click Add.
  7. Save the line item or proposal line item.

Advanced expression syntax

Key-values: When entering advanced expressions, ensure you use key names and value names, not display names. Only existing key-values can be entered—you can't create new values for existing keys, as you would with standard entry.

Audience segments: Audience segments can be targeted using the "aud_seg" key followed by the audience segment ID. For instance: 


Video content metadata: Similarly, video content metadata (CMS) values can be included with the "cms_metadata" key. For example: 


The "cms_metadata" key must use the numeric metadata ID value of the content of the metadata key, not its associated string or name.

To find a metadata ID value:

  1. Navigate to Video and then Metadata.
  2. Click the name of the metadata key.
  3. In the slide-in panel, find the numeric metadata ID next to "ID" near the name of the value. 

Use this numeric metadata ID after the "cms_metadata" key. Learn more about video content metadata.

Advanced expression operators

Below are some operators that help you enter a valid advanced expression. Expressions follow principles of propositional logic. You may refer to De Morgan's laws to learn more about logical principles.

Operator Description
" "

Double quotes. Use double quotes around value names that contain spaces. For example:

car="aston martin db5"


Equal sign—expresses "is". Use between key and values. For instance:


This key-value can capture a webpage or app devoted to Canadian news.


Exclamation point followed by equal sign—expresses "is not". For instance, consider this expression:


This input would target all other values of "age" except "18-32".


The "OR" operator. Not case sensitive—"or" also works. Use to connect expressions when only one expression among them needs to be true. Take the following for example:

age=18-32 OR age=33-42

This expression captures anyone between the ages 18 and 42. If a user visits your website or app and is aged 25, this targeting would satisfy the ad request. Only one of the expressions (age=18-32 in this case) needs to be true.

The operator must be used in English regardless of the language used for key-values. The equivalent of "or" in other languages isn't supported. In French, this expression would not produce expected results for instance:

voiture="aston martin db5" OU voiture="jaguar xj"


Comma. Same as the "OR" operator. Can be used instead of "OR"—for instance:

sport-interest=rugby, sport-interest=football,  sport-interest=ice-hockey 


The "AND" operator. Not case sensitive—"and" also works. Use to connect expressions when all expressions among them needs to be true.

age=18-32 AND sport-interest=ice-hockey AND page=canadian-news

This targeting captures users that are aged 18 to 32, who are interested in ice hockey, and who are visiting a webpage or app devoted to Canadian news. Users aged 18 to 32, who are interested in ice hockey, but visit your US news page, for instance, would not be targeted by this expression.

Like the "OR" operator, this operator must also be used in English.

Example of an advanced expression entry

Suppose your advertiser wants to promote a new athletic shoe, which is only available in Canada, the United States, and the UK. They want to reach users interested in certain sports—rugby, football, and ice hockey—but not others since their research shows that people interested in these sports are likely interested in their products. They are also aiming for a younger audience, users between the ages 18 and 32. 

You might enter key-value expressions as follows to reach this audience:

(page=us-news AND age=18-32 AND sport-interest=football) OR
(page=uk-news AND age=18-32 AND sport-interest=rugby) OR
(page=canadian-news AND age=18-32 AND sport-interest=ice-hockey)


Was this helpful?

How can we improve it?
Clear search
Close search
Google apps
Main menu