# Current page / URL rule

Canonical URL: https://support.optimonk.com/en/articles/current-page-url-rule

Specify the exact pages where you want your campaign to appear, or exclude the pages where you don't want it, with the **Current page / URL** rule — *Show or hide on specific pages*.

---

## 1. What is the Current page / URL rule?

*Use this rule when you want to display the campaign only to those visitors who are browsing a specific page of your site.* For example: show a popup only on your blog pages, or hide it on your cart page.

## 2. Why use it in targeting?

Take a jewelry store with several product categories. It matters that a product recommendation matches what the visitor is actually browsing. This is what the Current page / URL rule is for: an earring recommendation appears only on the earring pages, and a ring recommendation only on the ring pages.

---

## 3. How to set it up

1. Open **Campaigns** in the left menu and click the campaign you want to edit.
2. Open the **Settings** tab of the campaign.
3. Scroll to **Who should see the popup** and click **Add new rule**.
4. Pick **Current page / URL** from the list.
5. Add your page conditions in the two blocks (see below), then click **Save** in the modal.
6. Click **Save changes** in the bar at the bottom of the page.

On a campaign that is already published, the saved rule is pushed to the live campaign, so the change takes effect without publishing again.

💡 You can also ask the assistant on the right to do it for you — for example *"only on the blog pages"*.

---

## 4. Include and Exclude

The rule has two blocks:

- **Include** — *Show campaign only on these pages.* While it is empty, it says *No include rules — all pages are allowed unless excluded.*
- **Exclude** — *Don't show this campaign on these pages.*

Click **Add pages** in either block to add a condition row.

Each row starts with a dropdown:

- **pages** — then the row reads **where the URL**, followed by an operator and a value;
- **homepage** — then the row simply reads **only**, and needs no value. This is how you target (or exclude) the front page of your site.

The operators are **contains**, **equals**, **starts with** and **ends with**.

**Example:** to target every blog page, add an Include row with **pages** · *where the URL* · **contains** · `blog`.

### How the two blocks work together

- Include rules are **OR**-ed — the campaign shows if **any** include matches.
- Exclude rules always **win**: if any exclude matches, the campaign is hidden on that page.
- Leave Include empty to allow all pages and only rule out the ones you exclude.

If you leave a row's value empty, the modal refuses the save with *Each URL rule needs a value.*

### What the card shows

Once saved, the rule appears as a **Current page / URL** card in the targeting list. Depending on what you set, it reads *All pages (no URL restrictions)*, *Only show where the URL contains blog*, *Never show where the URL …*, or — with several rows — *Include 3 rules* / *Exclude 2 rules*. Click the card to reopen it.

Targeting rules are combined with **AND**, and each rule type can be added once: a Current page / URL rule already on the campaign is greyed out in the picker with an **Added** tag. Add further rows inside the existing card.

---

## 5. What this rule does not cover

- **Shopify / Shoprenter collection and product page types.** Picking a collection page by collection name or product count, or a product page by name, collection, price, type, vendor, availability or tag, is not available in this version of OptiMonk. In most cases you can achieve the same with a URL condition — for example *starts with*`/collections/earrings`. If you need the catalog-driven page types, set them in the classic OptiMonk admin (account menu → **Go to classic admin**); the campaign keeps such a rule, and this app shows it as a read-only card that reads *Managed in the OptiMonk admin — kept as-is, not editable here.*
- **Regular expressions.** The four operators above are the whole set; there is no RegEx option here. Rules built with a regular expression in the classic admin keep working the same way, but are not editable here.
