---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/support/adfox/en/targeting/url.md
  - https://yandex.com/support/adfox/ru/targeting/url.md
  - href: en/targeting/url.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/adfox/en/llms.txt

# By page URL

You can use targeting by page URL to:

- Show ads only on specific pages.
- Prevent ads from appearing on specific pages.

## Set up targeting {#settings}

1. <!-- source: en/_includes/targeting/select-campaign.md -->
   In the **Campaigns** tab, select an ad campaign or find one using the search bar.
   <!-- endsource: en/_includes/targeting/select-campaign.md -->
1. <!-- source: en/_includes/targeting/select-campaign.md -->
   Next to the campaign name, click ![](../_images/kebab-2.png =15x20) → **Targeting** or select a campaign and go to **Targeting**.
   <!-- endsource: en/_includes/targeting/select-campaign.md -->
1. Press **Add a targeting condition** → **By Url**.
1. Select the template type that you'll use to specify the page URLs:

    - [The standard template](*standard)
    - [Regular expression](*posix)

1. Specify page templates in at least one row:

    - **Acceptable patterns**: List those where you want to serve ads.
    - **Excluded patterns**: List those where you **do not** want to serve ads.
   
    {% note info %}
   
    You can specify up to five templates per row. To add a new row, use a line break (press **Enter**).
    
    If you leave the **Acceptable patterns** row empty and fill in only the **Excluded patterns** row, the campaign will be served everywhere except for the excluded pages.
   
    {% endnote %}

1. <!-- source: en/_includes/targeting/add-condition.md -->
   Click **Apply** and save the targeting criteria.
   <!-- endsource: en/_includes/targeting/add-condition.md -->

## Setup example {#example}

Let's say you have a section about vehicles (for example, `http://www.example.com/vehicles/`) on your site with a simple structure (`http://www.example.com`). It has a subsection about motorcycles: `http://www.example.com/vehicles/motorcycles/`.

You want to serve ads only in the “vehicles” section, not in the “motorcycles” section. To set up targeting:

1. <!-- source: en/_includes/targeting/select-campaign.md -->
   In the **Campaigns** tab, select an ad campaign or find one using the search bar.
   <!-- endsource: en/_includes/targeting/select-campaign.md -->
1. <!-- source: en/_includes/targeting/select-campaign.md -->
   Next to the campaign name, click ![](../_images/kebab-2.png =15x20) → **Targeting** or select a campaign and go to **Targeting**.
   <!-- endsource: en/_includes/targeting/select-campaign.md -->
1. Press **Add a targeting condition** → **By Url**.
1. Select a standard template type. 
1. In the **Acceptable patterns** row, enter `http://www.example.com/vehicles/`, and in the **Excluded patterns** row, enter a more specific template `http://www.example.com/vehicles/motorcycles/`.
1. <!-- source: en/_includes/targeting/add-condition.md -->
   Click **Apply** and save the targeting criteria.
   <!-- endsource: en/_includes/targeting/add-condition.md -->


<!-- source: en/_includes/feedback.md -->
## Contact support


<a href="en/form"> <!--ссылка, куда ведет кнопка. Если внутренняя ссылка, пишем без .md и .html --> 
  <span class="button">Send an email</span> <!--текст на кнопке--> 
</a>



<!-- source: en/_includes/styles/button.md -->

<!-- endsource: en/_includes/styles/button.md -->
<!-- endsource: en/_includes/feedback.md -->

[*standard]: A template type for sites with a simple structure. You can use the `*` symbol to [work with the template](https://yandex.com/support/adfox/en/ad-inventory/codes/referer-templates.md#standart-template).

[*posix]: A template type for sites with a very branched structure, such as one with multiple home pages. You can use [characters from POSIX regular expressions](https://yandex.com/support/adfox/en/ad-inventory/codes/referer-templates.md#posix-template).