Help Center/Key Values

Key Values (Custom Targeting)

PRO

Pass custom targeting parameters to Google Ad Manager for more precise ad delivery.

What are Key Values?

Key Values are custom targeting parameters that you send to Google Ad Manager with each ad request. They allow advertisers to target specific audiences and help you command higher CPMs for targeted inventory.

How It Works

1. You set keys

category = sports

2. NoAdCode sends them

With every ad request

3. GAM targets ads

Sports ads shown on sports pages

Standard Keys (Predefined)

Standard Keys are predefined keys that you can use readily without any setup. NoAdCode automatically extracts data from your pages for these 15 built-in keys:

KeyDescriptionExample Value
urlCurrent page URLhttps://example.com/post
pathURL path only/post/my-article
categoryPost categoriesnews,sports
tagsPost tagsfootball,champions-league
post_typeWordPress post typepost, page, product
post_idCurrent post ID123
authorAuthor usernamejohn_doe
author_idAuthor ID5
templatePage templatefull-width
device_typeUser devicemobile, tablet, desktop
referrerTraffic sourcegoogle.com
day_of_weekCurrent daymonday
hour_of_dayCurrent hour (0-23)14
logged_inUser login statustrue, false
user_roleWordPress user rolesubscriber, admin

Enabling Key Values

1

Access Key Values

Click NoAdCode → Key Values in your WordPress admin.

NoAdCode Key Values page showing standard keys
2

Enable Standard Keys

In the Standard Keys tab, toggle ON the keys you want to use. Enabled keys will be sent to GAM with each ad request automatically.

Popular Keys: category, tags, device_type, and post_type are commonly used for targeting.

Custom Key Values

Custom Keys are keys you create yourself from various data sources on your website. Unlike Standard Keys, you define exactly what data to extract and how to use it.

Ad-Unit Targeting: Custom Keys can be targeted to specific Ad-units, allowing you to send different key values to different ad placements.

NoAdCode Custom Keys tab showing custom key-values management

Creating a Custom Key

1

Click "Add New Custom Key"

In the Custom Keys tab, click the Add New Custom Key button. Enter a key name (e.g., subscription_tier).

2

Choose Source Type

Select where the key value comes from:

User Meta

Extract from WordPress user metadata

Post Meta

Extract from post/page custom fields

Cookie

Read from browser cookies

URL Parameter

Extract from query strings

3

Set Targeting (Optional)

Choose which ad-units this key should be sent to. You can target:

  • All Ad-units: Key is sent with every ad request
  • Specific Ad-units: Key is only sent to selected ad placements

Save and Activate

Save your custom key. Toggle it to Active and it will be sent with ad requests based on your configuration.

Common Use Cases

Content-Based Targeting

Use category and tags to show relevant ads.

Example:

category=sports → Sports equipment ads

Device Targeting

Use device_type for device-specific campaigns.

Example:

device_type=mobile → App download ads

Audience Targeting

Use logged_in and user_role for member targeting.

Example:

user_role=subscriber → Premium upgrade ads

Time-Based Targeting

Use day_of_week and hour_of_day for timing.

Example:

hour_of_day=12 → Lunch restaurant ads

Setting Up in Google Ad Manager

After enabling keys in NoAdCode, you need to configure them in GAM to use for targeting:

In Google Ad Manager:

  1. Go to Inventory → Key-values
  2. Click New key-value
  3. Enter the same key name as in NoAdCode (e.g., "category")
  4. Add the expected values
  5. Use these keys when creating line items for targeting

Important: Key names in NoAdCode and GAM must match exactly. GAM is case-sensitive, so "Category" and "category" are different keys.

Maximize Your Revenue

Key Values work best with header bidding. Learn how to integrate Prebid.js next.