Adding page URLs
🎬 Rather watch a video tutorial?
There are common templates for each website and online store. You want actual user data from this template that you can use. Therefore, we advise setting up tracking for all (or just the most popular) templates on your website. In terms of eCommerce, consider:
- Homepage
- Product Detail Page (PDP)
- Product Listing Page (PLP)
- Category page
- Cart
- Checkout page
- Blog
URL rule types
It is therefore at this level that optimisations are often made. When using our eCommerce subscription, it is recommended to set regular expressions. This way, you get more data from your templates, because you track all URLs that fall under this template. You can also enter exact URLs, should you have 10 products that perform best it is recommended to add all 10 under the same template.
Did you add or change URLs? Learn more about how soon you should see new data.
You can add URLs and templates in RUMvision in three different ways:
Exact Absolute URLs
Add one or more URLs of the same template you want to track and assign a page label. You will see the name of the page label within all RUMvision dashboards, so give them a clear name.
URL Path RegEx
Track with one line all URLs covered by a given template. We are happy to help write the regular expression for your webshop.
Jump to our Shopify section when running on Shopify.
CSS selector
Use a CSS selector to identify a group of pages by the presence of an element, attribute and value.
Ideally and to increase chances of matches when using CSS selectors, you should not use CSS selectors for elements that are client side rendered, or are rendered before our script will analyze your URL rules. This means that in general, it is best to not create CSS selector for elements that are client side rendered.
To actually make CSS selectors work, an element should have been parsed by the browsers when our snippet is running. Otherwise, it will never result in a match.
We will force our RUM to track on interactive state to improve tracking. See advanced snippet settings.
An example
The image below shows how we have configured www.rumvision.com. Well, we don't have very many pages, but we do have several blogs that we want to track at once without adding them all. Here we use the following regular expression:
^/blog/[a-zA-Z0-9-]+/$
Here's an alternative way of writing the regular expression, which results in the same as the dollar sign in the above expression is indicating that nothing will follow after the last slash:
^/blog/[^/]+/$
Through the advanced options of a URL, you can also pause or even block its tracking.
Matching order
It's important to note that your URL rules will be evaluated in the following order:
- Exact Absolute URLs
An exact match will be beat any other method when it comes to performance. That's why our script will first try to match with any absolute URL rules. - URL Path RegEx + CSS selector
Then, the Regex and CSS rules are executed in the same order as in your URL listing.
To change the order, you can select one or multiple URL rules and change move then down relative to others using the "with selected" button. This way, you can add blocking rules to actively block tracking of specific rules before our script proceeds to other URL rules.
Alternatives
Besides the above, you might have specific needs. They might be answered here. If not, feel free to reach out instead.
Track everything
Don't want to set up individual URL rules, but just want to track everything? Although your data won't be grouped in a way that allows for optimal analyzing, you can set up a regular expression that will track everything. This would be as following:
^/
This is a regular expression telling the browser that every URL's pathname that starts with a slash, should be tracked.
Exclude noindex pages
You can use CSS selector to exclude pages. Add the following CSS selector rule:
meta[name='robots'][content*='noindex']
Go the advanced tab and select "blocked". Any webpage where an element matching this CSS selector is found, will not be tracked
Shopify page types
If your shop is running on Shopify, you'll be able to benefit from auto-identifying page types. This way, you don't need to manually add all template types up front. We're able to do this as Shopify is exposing the page type via their server timing headers.
By leveraging this feature, just use auto
as the template name, and our RUM script will automatically transform this into the actual template type as exposed by Shopify. An example can be found in the screenshot below.
Examples of regular expressions you could use:
^/
A regular expression to track all pages.^/(collections|products|pages|blogs)/
A regular expression to only track urls that match this pattern.
Even with the auto
page label, RUMvision respects your URL rule matching order. This provides flexibility to override Shopify's naming conventions for other pages and URLs if needed.
Usage per template (pageviews)
Within the overview of your URL rules, you will also find the amount of pageviews per template. This is illustrated in the above screenshot when looking at the "Pageviews" column.
By looking at this column shortly after setting up or changing your URL rules, you're able to confirm if your URL rules are actually collecting data. Via the blue dropdown at the top of the page, you can request data of the previous month.
There will be a difference between the amount of pageviews you see in the URL listing and the dashboard numbers:
- the URL listing is using pageviewcount based on TTFB events.
- URL listing is showing all pageviews across all devices while our technical dashboards will not.
There are a few nuances here:
- we will fetch the amount of pageviews per configured template type name;
- if a template type name isn't in your URLs anymore, we will show them below the table as unattributed pageviews;
- if a template type name does exist, we will show it within the same table row in the pageviews column;
- if you have multiple URL rules with the same template type name, we will only attribute it once (to the first occuring template type name);
- as a result, other URL rules with the same template type name won't show a template type name. This is illustrated in the above screenshot where there are two URL rules with the same template name.