07Tracking
Page categories
How to group pages into categories, with rules in site settings or content_group markup, and where categories show up in reports.
Categories group pages, such as Blog, Products or Landing pages, and show the same metrics for each group as for a single page. You can set them with rules in site settings (no code) or with markup on the page itself.
Two ways
| Method | Where it's set | When it's applied |
|---|---|---|
| Path pattern → category rules | site settings in the dashboard | when a report is built, including past data |
content_group markup | the page HTML | the tracker sends the category with the page view |
Both methods work together. If a page has explicit markup, it takes priority over the rules.
Rules in site settings
Rules are an ordered list. Each page gets the first rule that matches, so put specific patterns above general ones and * last.
| Pattern | Category |
|---|---|
/blog/* | Blog |
/product/*, /catalog/*/item-* | Products |
/lp/*, /promo/* | Landing pages |
/ | Home |
* | Other |
Rules are applied at query time, not when events are stored. Change a rule and all past periods are recalculated; the change shows up in reports within a few seconds.
The dashboard is currently in private beta; request access at /beta.
Markup on the page
Add a meta tag to <head>:
<meta name="gauss:content_group" content="blog">or an attribute on the root element:
<html lang="en" data-content-group="blog">How the tracker handles it:
- the category is read on every page view, including SPA navigation;
- if both the meta tag and the attribute are present, the meta tag wins;
- the value is cut to 100 characters, and an empty value isn't sent;
- the category goes into the
content_groupfield of thepage_viewevent.
In an SPA, the tracker reads the markup right after the URL changes (pushState, replaceState, popstate). If your router updates <head> later, the page view may carry the previous page's category. In that case, rules in site settings are more reliable.
An explicit category is stored with the event, so changing it only affects new page views. Rules, on the other hand, recalculate history too.
Example: blog
To see a Home → Blog → Article step in user paths, separate the article list from the articles. The rule for the list page goes above the rule for articles:
| Pattern | Category |
|---|---|
/blog/ | Blog |
/blog/* | Article |
/ | Home |
Example: online store
| Pattern | Category |
|---|---|
/catalog/*/item-* | Product |
/catalog/* | Catalog |
/cart, /checkout/* | Checkout |
/lp/* | Landing pages |
* | Other |
If product URLs have no common pattern, add markup to the product page template:
<meta name="gauss:content_group" content="Product">Where categories are used
- Category report: page views, visitors, time on page, entrances and exits, conversions, the same as for a single page.
- User paths: graph nodes can be pages or categories. Several articles in a row collapse into one Article node; clicking a node shows which pages it contains. Details: Goals, funnels and paths.
- History: daily category reports are available for the full retention period of daily summaries, because rule-based categories are computed from the page path at query time.