Help Center Manage Your Account Ad Targeting using Restrictions

Target ads by placement URL or referring URL

You can show an ad to visitors viewing a certain web page (placement URL) or coming from a certain web page (referring URL). You can block an ad from showing on a specific page or section. URL matching is done with a regular expression. Wildcard is supported for partial matching. For advanced matching, basic knowledge of regular expressions is required.

Example

This website has 2 main sections: Travel and Music. Here is the URL structure:
  • http://example.com/Travel/
  • http://example.com/Travel/Florida.html
  • http://example.com/Travel/California.html
  • http://example.com/Music/
  • http://example.com/Music/Electronica.html
  • http://example.com/Music/Pop.html

Objective: you do not want Travel ads to display in the Music section and vice versa.

Solution: Add a placement URL restriction on the Travel ads to prevent them from showing when the placement URL is one of the Music pages

  • Sign into your account, follow the menu Ads / All
  • Click on an ad name
  • Click on the Restrictions tab, click on Add
  • Choose the restriction type Placement URL
  • Choose Don't Show mode
  • Type in a path or folder/directory that is unique for the target page(s). You can include the full domain or just the matching pattern string
  • In our example, it would be http://example.com/Music/*. Wildcard can be used to match all pages within a section
  • Save the new restriction and this ad will not be shown to visitors when they are in the Music section
The same instruction applies when you want to target ads by referring URL, which is the page where your visitors come from. Please note that referring information depends on the visitor's browser. Some browsers have settings and plugins to hide, block or modify this referring URL value.

Domain Matching

In order to restrict an ad to only display on certain domains and hostnames, you can use this special format:
DOMAIN(example.com|www.example.com)
In this example, the ad will not show if it is being served on a different site other than the two registered hostnames. Sub-domains are considered as unique hostnames.

Combining Multiple URLs

Instead of creating multiple URL restrictions, which can be time consuming, you can combine multiple URLs that share a similar pattern together. For example:
  1. Don't show to visitors viewing page http://example.com/signup/publisher
  2. Don't show to visitors viewing page http://example.com/signup/advertiser
  3. Don't show to visitors viewing page http://example.com/signup/ad-agency
  4. Don't show to visitors viewing page http://example.com/signup/ad-exchange
Since they share the same domain and path, they can be combined into one URL restriction:
  1. Don't show to visitors viewing page http://example.com/signup/(publisher|advertiser|ad-agency|ad-exchange)

Advanced Matching

Follow these instructions if you want to show this ad only on specific sections. For example: ad AdServer should only display when a visitor is browsing these 3 content sections: Marketing, B2B, or Advertising. A placement URL restriction can be created as follows:
  • Match by name: Show to visitors viewing this page *&SectionName=(Marketing|B2B|Advertising)
  • Match by ID: Show to visitors viewing this page *&SectionID=(222|333|444)
  • Match anywhere: Show to visitors viewing this page (Marketing|B2B|Advertising)

If you would like to show only for any section with a valid numeric ID: *&SectionID=[0-9]+

The pipe sign | means any value between the parentheses. For example: (A|B|C) means A or B or C. For more technical usage, our ad serving engine uses regular expression to match the URL with your restriction.

To restrict the end of a string, add $ to the pattern. Example: http://example.com/travel$. This will only match the exact/full URL and will not match http://example.com/traveling or http://example.com/travel/. URLs with or without a trailing slash should be redirected to a consistent URL scheme.

Evaluation Priority

Learn more about the difference between Proactive Targeting vs. Passive Restriction setting.

Considerations

  • The availability of referring information depends on the browser. Some browser add-on/setting can block or modify referral information from passing onto the request and restrictions based on referring URL will not work properly.
  • Referrer-Policy header will determine if and how referring data is sent via the ad request for targeting. If it is empty, limited or truncated and you depend on it for targeting, you can overwrite with your own value to the ad request. Contact us for technical integration.
  • Reporting are available per zone and per ad. Reports are not available per URL or per restriction.
  • When generating the serving code, it is recommended to choose the Comprehensive serving code format to ensure the referring and placement URLs are captured properly. If you need an ad serving feature that is only available with a JavaScript ad tag, you might need to add additional JavaScript tracking code to properly capture the referring URL. Please contact us for technical assistance in adding this tracking code.

Example Setup

Print Was this helpful? Yes / No

Other Articles in Ad Targeting using Restrictions

Learn about ad targeting and restrictions ad serving such as frequency capping, geo-targeting, quota, roadblock, flight date, etc.

Cannot find an answer for your question? Ask our Customer Care team

Related