Page rules with worked examples
Exactly what to type to show a campaign on the home page only, on product pages, on one page, on a sale, after an ad, or everywhere except the checkout.
Page rules compare the address of the page with what you type. These examples use yourstore.com; replace it with your own address.
How an address is read
https://yourstore.com/collections/sale?utm_source=instagram#reviews
| | | |
site path parameters anchor- Capital letters do not matter, and a slash at the end is ignored.
- contains looks at the whole address up to the anchor.
- starts with and is look at the path.
In the simple questions
Open the card Who should see it? in Where & when.
Every page
Choose Every page.
The home page only
Choose Home page only. It shows only on yourstore.com/ and not on any other page.
Some pages
Choose Only some pages and type part of the address:
- /products shows it on every address with /products in it, such as yourstore.com/products/red-shoes.
- sale shows it on any address with the word sale, such as yourstore.com/summer-sale.
- /blog shows it on your blog pages.
Type part of the page address. Until you do, it shows on every page.
In the rule editor
Use the condition Page URL. See The full rule editor for how to add it.
One exact page
Page URL is /pages/contact. You can also paste the full address, https://yourstore.com/pages/contact; it matches with or without www.
A whole part of the site
Page URL starts with /collections/. It matches /collections/sale and /collections/new, and not /pages/collections-guide.
Everywhere except the checkout and the cart
Put two conditions in one group set to All: Page URL does not contain /checkout, and Page URL does not contain /cart.
To do this for every campaign at once, add /checkout and /cart under Never show campaigns on these pages in Settings instead. There, /checkout covers every page under it, and * stands for any part, as in /account/*.
Product pages or collection pages
Put two conditions in one group set to Any: Page URL contains /products/, and Page URL contains /collections/.
Visitors who arrived from one ad
Use URL parameter: the parameter utm_source is instagram. For any visit that landed on your sale page first, use Landing page with /sale.
A link that opens the campaign
Use URL anchor with the anchor offer. Then yourstore.com/#offer shows the campaign.
Only pages that have a certain element
Use HTML element with a CSS selector, such as .product-form, to show only on pages that contain it.
Pages by their title
Use Page title: the title contains Abaya.
After they looked at pricing
Use Visited earlier with /pricing: it matches visitors who saw that page earlier in this visit.
Check your rule
- Publish the campaign.
- Open a page that should match with ?tafsee-debug=1 at the end of its address. The panel says whether the page rule lets the campaign through.
- Open a page that should not match and check that the panel says the page is excluded.
If it does not work
- It shows on too many pages: contains sale also matches /wholesale. Use a longer piece of the address, or starts with.
- It shows nowhere: check for a typing mistake, and that you did not use is with only a part of the address.
- A visitor can't be on two exact URLs at once. Use Any, or keep one URL.