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 https:// or http:// 
  • Domains and subdomains like which use .  as the delimiter
  • A path like /document/d  which use /  as the delimiter
  • Query params like ?queryA=1&queryB=2 which use ?  as the first delimiter and &  subsequently
  • Fragments like #fragmentA=1&fragmentB=2 which use #  as the first delimiter and & subsequently

🍏Pro tip
Paths and query params can come both before and after fragments.

🤓Rule syntax

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
  • An item  is 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.

  • https://*  tracks and not (as *  makes it mandatory to have at least one item)
  • https://**  tracks, and 
  • https://example.*  tracks  and 

Examples for paths using / as the delimiter

  •*  tracks and doesn't track 
  •** tracks,,  

Examples for query params using ? as the delimiter

  •* tracks and not 
  •** tracks, and, 

Examples for fragments using # as the delimiter

  •* tracks and not  
  •** tracks, and 

🤓Putting it all together for Google Docs

Google Docs have urls like

Let's try to understand why*/**?**#**/**?** matches this.

Breaking it down:

  • is how all Google Doc urls start. By doing this we ensure that we don't wrongly consider, and so on as Google Docs.
  • /* specifies that we absolutely expect some kind of doc identifier (like 1cMLTVBv1zJn6dxA12d9eZVA_N7IR2cxKZxzVytBnDe2pE in the url example above). All Google Docs have this.
  • /** is to match 0 or any number of path items (so / , /edit , /view and so on)
  • ?** is to match 0 or any number of query items (so no query param, ?abc=1 , ?abc=1&def=2 and 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.6sxwkvhv1drt and so on). 
  • /**?** is to match 0 or any number of more path and query param items that can appear after the fragments

🍏Pro tip
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 :)

Did this answer your question?