How to exclude pages from "Visits a page" in the Decision criteria?

Your software
My Mautic version is: 4.3.1
My PHP version is: 7.4.33

Your problem
My problem is:

Trying to show Focus Item to most of a website but excluding a few pages, such as the page the popup links to. I was looking for a way to achieve this in the js implementation but have ended up trying to create a campaign using this method.

Problem is that I want to use the popup on almost all of the website pages, minus a small handful. Do I need to list all the pages in comma separated format in the “Visits a Page” conditions?

Sorry if this is basic, I’ve searched forms and documentation and can’t find anything. I feel like this should be achievable using a simple expression in the condition parameters but I have no clue what it should be. :expressionless:

For example, is it possible to use “!example.com/not-this-page” in the URL condition field? Can I use the ! parameter here? And could I combine that parameter with a wildcard, e.g. “example.com AND !example.com/not-this-page” ?

So clearly too n00b of a question to be popular in support. AFAIK, Mautic doesn’t allow this. Would be happy to be proven wrong about that.

If you come across this item and need a solution, if you are using wordpress or another php based site, my workaround was to use this php snippet to control when the scripts fire. But instead of using if ( is_page('my-page') ) to display on specific pages, use if ( !is_page('my-page') ) to restrict your pages. Tested and so far this seems to be working fine.

I might be missing something here but if you are using the campaign to trigger the popup, you could use the green path for has visited, and the red path for has not visited. So you could (I am hypothesising) chain a yes path (has visited url A) with a subsequent no path (has not visited url B).

The challenge could be in the ordering though as someone might visit B before A, so they would already be down the ‘no’ path - so might need some careful thinking through.

The workaround you suggest would work I guess but just be aware you would lose tracking on the pages you are excluding for all visitors - you can do similar with Google Tag Manager for example.

Also wanted to add, expecting a reply within a day from volunteers is quite a demand to make - it might just be that nobody was able to answer or did not have time, rather than it being too noob a question.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.