If we want to target visitors only on the front page we can do so by using the “Visitor’s url (regexp)” condition.
The challenge with the basic “Visitor’s url contains” rules condition is that it does not look at what comes before or after the given string. If we have a rule with simply “Visitor’s url contains: giosg.com”, the condition will be met on all pages on giosg.com as all pages contain “giosg.com”.
If we want to target visitors only on the front page we can do so by using the “Visitor’s url (regexp)” condition. This allows us to do different tricks with URLs by using javascript regular expressions. The url for the front page is added to the condition and a $ is added at the end of it. This way we are checking that the visitor’s url is exactly the given URL and there are no characters after it.
As an example, we want our rule to trigger for visitors on the https://www.giosg.com/ front page
Our rule condition would therefore be: When Visitor’s url (regexp) matches: giosg.com/$