Traffic measurement rules
Overview
The Tracking rules
4Analytics configuration page lets you set up rules to decide which pages and visitors should be measured.
You may be used from analytics services to copy/paste a small javascript code snippet into either your template index.php file, or in configuration pages, but you do not need any of that with 4Analytics.
Using rules instead of a code snippet is at the same time very flexible and very easy. In most cases, you don't even have to create a rule, you just enable the default one.
4Analytics comes with a default rule that measures all pages, excluding all logged-in users.
For most sites, that's the only rule you want, and it can be [enabled from the initial installation wizard with one click)(../getting-started/initial-setup/#initial-configuration-wizard-and-just-getting-started.md).
Rules list
If you ever need to change this default rule, or add more, here a sample list:
From there you can create
, enable/disable
or delete
a rule. Or click on a rule to modify it. Opening a rule shows 3 tabs:
Name & ordering
This tab is only for your usage: enter a meaningful name and any notes about that rule. The default rule is called All pages, guests only
to reflect its purpose.
When to run
On this tab, you decide when
the rule should run, meaning which pages are going to be measured.
There are many conditions you can set there, for instance:
- specific group of URLs (track only
/shop/{*}
or/blog/{*}
) - content categories
- user groups
- languages
- Joomla components
- value of custom fields
- IP addresses
- User Agent strings
Here is how the default rules exclude any logged-in users, by only allowing measurements for Guests
:
Exclude your IP address from measurement
If you are the owner of a website, or maybe the administrator, it is common to want to remove yourself from measurements, to avoid interfering with actual users traffic measurement.
This is done very easily under the Do not run for these IP Addresses
field. Enter one or more IP addresses in the list and 4Analytics will not measure anything when you visit the site from these IP addresses.
This is made even easier by using the Exclude your current IP addresses
button just below that field:
After clicking that button, 4Analytics automatically insert your current IP addresses in the input field. Both IP address version 4 and version 6, if available, are added.
What to do
On this tab, you can set measurement options specific to the group of pages and users you selected under When to run
.
Options are limited at the moment, and we'd definitely advise to leave them at their default values:
-
Only use URL path
: this means pages with addresses that have query variables ( similar to/my-page?id=12345
where?id=12345
is called the query variable) should have their query variables discarded when tracked. In our example, this means that this page would be measured as if/my-page
was viewed.You should only set this to
No
if you use Joomla extensions that have meaningful query variables in the URLs they create -
Include visitors without javascript
: by default, 4Analytics only measures visitors that use a device and browser with javascript available. This already eliminates a lot of the simpler spam robots, make your statistics more accurate and reduce the load on your server.You can enable measurement of visitors without javacript if you have a very specific reason for that. If so, please talk to us first, we'd like to know what your use case is for this.
-
Tracking code for other, non-Joomla websites
: this is a very special feature. Some of us have websites with a mixture of pages created by Joomla and by another system. 4Analytics being a Joomla extension, it would normally only measure pages that are created by Joomla.If you are in this situation however, you can copy/paste the javascript snippet presented to you by 4Analytics into your other system template, and 4Analytics will measure these pages just like it does for your Joomla pages.
If you do so, and these pages are under another website address (for instance a sub-domain), you'll need to list both the main site and the sub-domain in the rule
Run for these home addresses (domains)
field on theWhen to run
tab
Using a non-Joomla system
This last use case is likely rare but we at weeblr.com are exactly in that situation. Weeblr.com is a standard Joomla website, except for the very documentation pages you are reading right now.
We create these pages with another system (Material for MkDocs
) and the generated pages are just served under the /doc
subfolder, in the middle of the site Joomla pages. 4Analytics measures traffic on all pages exactly the same