Skip to content

Publisher Tag Targeting

Positional Targeting

On-page placement of an ad unit is achieved via CSS selectors. You will need to be able to look at your website's HTML and pick the elements you want to target, and using your knowledge of CSS selectors be able to uniquely identify them in code.

Don't worry if all of this sounds alien, CSS Selector-based targeting is highly flexible, but requires an experienced web developer to implement. If you don't have a web developer on your team, a member of our team will be available to help!

Advanced CSS selectors

Most of your targeting will use basic CSS selectors, as shown in the example tables below. These consist of using classes and IDs to identify and target your desired page elements. However, we support a large range of more advanced selectors, one useful one you may find helpful is the :nth-child selector.

These types of selectors allow you to do useful things such as targeting every 3rd paragraph on an article page (.article-page p:nth-child(3n)). Or targeting every 4th paragraph starting with the 1st (.article-page p:nth-child(4n-7))

More information on :nth-child selectors can be found here: https://css-tricks.com/useful-nth-child-recipies/.

It is also worth noting that you can include multiple selectors in a single config by simply using a comma, no need for multiple configs!

In-Image Examples

Type Selector Example Notes
class + img .post_content img To target the contents of an element (div, span etc) use class (.) In the example you would be targeting all <img /> tags, inside of the element <div class="post_content"></div>
id + img #content img To target the contents of an element (div, span etc) use id (#) In the example you would be targeting all <img /> tags, inside of the element <div id="content"></div>
class .post_content To target the contents of an element (div, span etc) use class (.) In the example you would be targeting all <div class="post_content"></div> elements
id #content To target the contents of an element (div, span etc) use class (#) In the example you would be targeting all <div id="content"></div> elements

In-Article Examples

Type Selector Example Notes
class + tag .post_content p To target the contents of an element (div, span etc) use class (.) In the example you would be targeting all <p> tags, inside of the element <div class="post_content"></div>
id + tag #content p To target the contents of an element (div, span etc) use id (#) In the example you would be targeting all <p> tags, inside of the element <div id="content"></div>
class .post_content To target the contents of an element (div, span etc) use class (.) In the example you would be targeting all <div class="post_content"></div> elements
id #content To target the contents of an element (div, span etc) use class (#) In the example you would be targeting all <div id="content"></div> elements

Device Targeting

You can also target individual configs based on device type (mobile, tablet or desktop), or any combination thereof. Simply select the devices you need, simple!

This opens up a huge range of flexibility. Want a video unit that sticks on desktop & tablet, but not on mobile? Easy. Create one config with desktop & tablet selected and sticky enabled. Duplicate the config and select just mobile while disabling sticky.

Use as many individual configs as you need to achieve your desired setup!

Geographic Targeting

Target countries easily by including or excluding them as required. Target fallback creatives to better match the audience or tailor your ad stack!

Browser Targeting

You can target any of the top 7 browsers, representing 95% of all internet traffic. This is great for trialling different ad stacks for the likes of Safari with its intelligent tracking prevention features, vs others.

Viewport Targeting

While device targeting as described above allows for quick and easy targeting of key device widths, viewport targeting offers highly customisable width targeting to perfectly match your sites custom breakpoints.

If your site has a special wide breakpoint such as anything equal to or above 1400px, you can easily target this with a value of ≥1400px.

This field will accept up to two values; a start value and an end value (to capture a breakpoint range), or just one value with an open start or open end (see example below).

All values will be assumed px, pixels. We accept the following comparison operators:

  • >= Greater than or equal to.
  • <= Less than or equal to.
  • > Greater than.
  • < Less than.

Remember to enter your viewport declaration in to the field and hit enter to commit it, you can then add a second one if required, hitting enter again.

Examples

  1. <576px -- Open start, so anything from 0 up to a maximum of 575px
  2. ≥576px -- Open end, so anything from 576px upwards
  3. ≥1200px,<1400px -- Range, anything from 1200px up to 1399px

URL Path Targeting

We also support config targeting down to the URL path. Only want adhesion on article pages? Want to try out a new config on a single old article? Not a problem!

URL path targeting is done via one of two behaviours; include or exclude.

Selecting "include" enables the config on all pages that match your list of URL paths. "Exclude" enables the config on all pages that don't match your URL path list.

Matches are made against the URL path, the bit highlighted in green here: https://docs.contentignite.com/publishers/tag-targeting/#advanced-css-selectors

So to match the above URL, the target would need to be /publishers/tag-targeting/.

Wildcard Matching

We also support wildcard matching where you'd like to match against URL path patterns.

For example, take the following common URLs where there is a category and a post name in the URL:

  • https://the-race.com/formula-1/aston-martin-f1-chief-szafnauer-exits-team/
  • https://the-race.com/formula-e/formula-es-new-qualifying-format/
  • https://the-race.com/motogp/what-to-expect-from-petruccis-dream-dakar-switch/

What if we wanted to match all "formula-1" articles on this site? This is where the wildcard character comes in; *, it matches any number of characters.

To target "formula-1" articles, we can simply use the target:

/formula-1/*

We always match from the start of the path to the end of the path. In this case, the wildcard character matches anything after /formula-1/, therefore matching any articles within that section as they start with /formula-1/ and end with any other characters.

Also, consider the following URLs:

  • https://the-race.com/formula-e/results
  • https://the-race.com/motogp/results

We could easily target all result pages with:

/*/results

In this case, (because we match from the start to the finish) the wildcard character matches any characters at the start of the URL path, and then we match /results at the end of the URL path.

Combine wildcard matching with the ability to add as many entries as needed and you can tailor advertising across your site in an incredibly flexible way, down to a hyper-targeted level.

Something or nothing

Please note that * matches anything, including nothing. If you'd like to match "something" like any subsection under /section/, use a double wildcard like so: /section/**

Additional Examples

Target Example Notes
/ Matches the home page only
/news Matches the news page only
e.g. Would match:
  • https://www.newspaper.com/news
but wouldn't match:
  • https://www.newspaper.com/news/covid-is-over
/news/* Matches pages within the news section only
e.g. Would match:
  • https://www.newspaper.com/news/covid-is-over
but wouldn't match:
  • https://www.newspaper.com/news
/news* Matches any pages whose URL path starts with "news"
e.g. Would match:
  • https://www.newspaper.com/news/covid-is-over
  • https://www.newspaper.com/news
  • https://www.newspaper.com/news-archive
  • https://www.newspaper.com/news/2020/01
/news/*/01/* Could match any news article posted in January (given a well-structured URL)
e.g. Would match:
  • https://www.newspaper.com/news/2024/01/covid-is-over
  • https://www.newspaper.com/news/2020/01/what-have-we-done
but wouldn't match:
  • https://www.newspaper.com/news/2024/01/
  • https://www.newspaper.com/news/2022/02/covid-is-still-going
/news/** Could match any news article posted in January (given a well-structured URL)
e.g. Would match:
  • https://www.newspaper.com/news/2024/01/covid-is-over
  • https://www.newspaper.com/news/2020/01/what-have-we-done
but wouldn't match:
  • https://www.newspaper.com/news/