Product rules are incredibly powerful in eesel. You can specify which url patterns you want to track and which you don't using a special rule notation based on
glob patterns. For instance, to start tracking every page for Google Docs, the pattern would be:
What does this mean? Let's read on.
🤓What is a URL?
For the purpose of this, you just need to loosely understand that a URL has:
- A scheme and protocol like
- Domains and subdomains like
.as the delimiter
- A path like
/as the delimiter
- Query params like
?as the first delimiter and
- Fragments like
#as the first delimiter and
Paths and query params can come both before and after fragments.
The main notations are as follows:
.is the delimiter for domains
/is the delimiter for paths
?is the delimiter for query params
#is the delimiter for fragments
itemis a string of characters along with a delimiter
*matches one item
**matches 0 or multiple items
Let's apply all this.
Examples for domains using . as the delimiter.
*makes it mandatory to have at least one item)
Examples for paths using / as the delimiter
https://example.com/abcand doesn't track
Examples for query params using ? as the delimiter
Examples for fragments using # as the delimiter
🤓Putting it all together for Google Docs
Google Docs have urls like
Let's try to understand why
https://docs.google.com/document/d/*/**?**#**/**?** matches this.
Breaking it down:
https://docs.google.com/document/d/is how all Google Doc urls start. By doing this we ensure that we don't wrongly consider
https://slides.google.comand so on as Google Docs.
/*specifies that we absolutely expect some kind of doc identifier (like
1cMLTVBv1zJn6dxA12d9eZVA_N7IR2cxKZxzVytBnDe2pEin the url example above). All Google Docs have this.
/**is to match 0 or any number of path items (so
/viewand so on)
?**is to match 0 or any number of query items (so no query param,
?abc=1&def=2and so on). Note: the example url doesn't have any query params.
#**is to match 0 or any number of fragment id items (so no fragment,
#heading=h.6sxwkvhv1drtand so on).
/**?**is to match 0 or any number of more path and query param items that can appear after the fragments
You'll notice that we often use the
/**?**#**/**?** in our managed product rules as this is a 'catch all' pattern for paths, query params and fragments.
That's it 🎉! Have a look at some product rules of managed products to get a feel of different patterns. You can always just reach out to us via Intercom if you're stuck :)