Keyword targeting

Targets let you show different ads in the same zone for different users or pages in the publisher's site. With keyword targeting, you can serve the assigned campaign only on pages with certain URLs or words. You can also use keyword targeting to require specific publishers to be served, or to exclude them from being served certain ads.


This guide will show you how to use keyword targeting in campaigns and in email ads. For other forms of targeting, read Geographic and location targeting, Platform & device targeting, and Data Keys. To find out how to set schedules and target dates, days, or periods, read Pacing & Schedule.

You will learn:

  1. How keyword targeting works.
  2. About keyword syntax and special keyword characters.
  3. How to assign keywords to a campaign.
  4. How to enable keyword targeting in the publisher's website.
  5. How to check if a keyword is properly set in the publisher's website.
  6. How to enable keyword targeting in email ads.

How keyword targeting works

For websites, whenever an AdButler zone tag is loaded in a page, the global JavaScript variable window.abkw is recorded as the keyword for that page. This is the variable to which keywords are assigned. In most cases, window.abkw won't be set to any keyword and AdButler will ignore it.

For emails, the keyword variable is kw. You must manually include this variable in the email zone tag along with the keyword to enable targeting in email ads.

If window.abkw or kw is set to a keyword, AdButler will then look at the assigned ads or campaigns in the zone to see if any of them match the keyword.

  • If an ad or campaign's keyword is set to Preferred, the matching ad will be more likely to appear.
  • If the keyword is Required, the matching ad will have a chance to be served only if the keyword matches, and its chance of being served increases.
  • If a keyword is Filtered, the matching ad will have a chance to be served only if the keyword matches, but its likelihood of being served does not increase.
AdButler does not search pages or URLs for keywords. You need to manually specify the keywords for window.abkw when adding the zone tag into the publisher site. If the publisher site has variables for keywords, make sure to assign the appropriate variable to window.abkw See Enabling keyword targeting in the publisher's website.

Keyword syntax and special characters

Keywords and keyword macros

  • string: this is the word or phrase that you want to be in the publisher's page, e.g. news.
  • inurl:: a keyword macro that you use to target a string in the publisher's URL instead of within the page. Do not add a space between the colon and the string, e.g. inurl:news.
  • publisherid:: a keyword macro that you use to target a specific publisher based on the publisher ID. Do not add a space between the colon and the ID, e.g. publisherid:12345.

Special characters

Aside from the string itself or the keyword macros, there are special characters that extend the features of keyword targeting, such as letting you search for multiple keywords at once, or excluding the matching page or publisher from being served.

* A wildcard character.
For example, *ews will match any four letter word within the page that ends in "ews".
- Specifies that a keyword is a negative match. While a regular match gives an ad a chance to be served, a negative match prevents the ad from appearing at all. This works with all keyword types. Do not add a space between - and the keyword.
For example, -publisherid:12345 tells AdButler not to serve the ad or campaign to that publisher.
, Allows you to specify multiple keywords. This works with all keyword types, but it is an OR operator. In other words, AdButler will consider a match even if only one or some of the keywords match. Do not add a space between keywords and commas.
For example news,inurl:news,-publisherid:12345 tells AdButler to serve the ad to a page with the word "news" within the page, a page with "news" in the URL, OR to sites that are not owned by publisher 12345.
+ Makes a keyword a required match. If the keyword is not detected, the ad will not be served. Do not add a space between + and the keyword.
For example, +inurl:news will serve the ad only to pages with "news" in their URL.
() Groups keywords together. This lets you apply other special characters to groups of keywords as if they were individual keywords. This is an AND operator.
For example, +(news,inurl:news,-publisherid:12345) tells AdButler to serve the ad only to pages with a match of the first two keywords, AND are not owned by publisher 12345.

Assigning keywords to a campaign

  1. Go to the relevant campaign's dashboard (Advertisers > Your Advertiser > Your Campaign).
  2. Click Assign to Zone under the Zone Assignments table.
  3. Select a zone to which the campaign will be assigned. The Assignment Details page will appear.
  4. Select a serve method. The rest of the settings will appear.
  5. Set the initial settings as needed, then scroll down to the bottom of the page. Click Targeting to expand its settings.

  1. Enter your keyword or keywords. Be sure to use the correct syntax.
  2. Click Save.

You can now enable keyword targeting in your publisher's website.


Enabling keyword targeting in the publisher's website

These instructions show the most common way to set keywords in the publisher's website.

  1. Open the source code for the web page header.
  2. Add this snippet to the header, replacing 'YOUR_KEYWORD' with the keyword for the page. Be sure to enclose the keyword in single quotes.
<script>
window.abkw = 'YOUR_KEYWORD';
</script>
  1. Save your changes.

Checking if a keyword is enabled in the publisher's website

  1. Open the page in a browser.
  2. Right-click the page then select the inspect option. The browser inspector will open.
  3. Click on Console.
  4. Search for window.abkw within the console. If it appears and has the right keyword, then the keyword was properly set.

Enabling keyword targeting in emails

  1. Go to the dashboard of the email ad zone to which you assigned the campaign (Publishers > Your Publisher > Your Email Ad Zone).
  2. Click Get Zone Tags on the far right panel. The Zone Tags window will appear.
  3. Add kw=YOUR.KEYWORDwithin the img src tag, replacing YOUR.KEYWORDwith the keyword for the email. Do not add quotation marks to the keyword.

  1. Copy the entire zone tag.
  2. Log in to your admin dashboard in your email provider and create a new email template.
  3. Look for the field in the template where HTML code is added. Paste the zone tag into that section.
  4. Save the template.
For more information on creating email ads, read Serving ads in an email newsletter.

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.