Inserting Analytics tracking code
In addition to simply inserting Google Analytics tracking code in your pages, sh404SEF has more options to help you deal with common situations:
Enable data collection
As seen on the Getting started page, there are currently 3 options to use Google Analytics:
- the regular Analytics called
v4: the default from 2021
Universal Analytics: the standard up to 2021, still available for years
Google Tag manager.
Google Tag manager
sh404SEF can insert for you the
Google Tag Manager code, you only need to select this option in the
Enable data collection drop-down, and paste in your Google Tags manager ID in the corresponding field.
Analytics Custom code
You can enter here any analytics-specific code you need for more advanced uses. The code you enter will be added exactly as you enter it at the end of the Analytics snippet.
Custom code is only inserted when using either
Universal Analytics Additional options
sh404SEF provides a few other options to improve your use of Google Analytics Universal. They do not apply to version 4 or to Google Tag Manager.
GTM, there are options, but you can set them at your Google Analytics control panel.
Please be sure to check your locally applicable law to decide if you need this or not.
Enable Display features
Enhanced link attribution
The enhanced link attribution plugin is another Google Analytics plugin which may improve the accuracy of click tracking on your pages. It is useful in case you have multiple links to the same URL on the same page as it allows differentiating clicks on each link, thus allowing you to fine-tune or improve your pages.
As per the documentation linked above, using the Enhanced link attribution plugin may require that you also make some changes to the links you want to track (they must have their own individual html id). The plugin must also be enabled in your Google Analytics account settings.
Snippet insertion options
A common issue with Analytics is to get reliable data about your visitors, but only about your visitors. On some sites, visits from your company staff or other unwanted sources can become a bias. You can list here multiple IP address (IPV4) that should be excluded from Analytics. When a request comes from one of those IP addresses, sh404SEF will NOT include the Analytics snippet in the page, and they won't be counted at all.
Enable/disable for access levels and groups
Another option to exclude some visitors from the stats is to discount users from certain groups or for pages that require specific access levels. You can achieve this with sh404SEF using the
Enable for access levels ,
Enable for groups and
Disable for groups select lists. This will allow you to discount from analytics traffic all Super users, for instance, or maybe support staff.
By default, the
Enable for access levels setting includes the
Public level. It means that all visitors will be accounted for. Be sure to check your site still has this access level (it should unless extreme customizatio was done during the site construction).
To avoid interfering with users groups attribution, we often create a specific group, called
No-Analytics, and we put all users that should not be included in Analytics stats in that group. You can also do the same with access levels.
Custom Analytics tracking code
/your_template/html/layouts directory. Please read the Joomla! JLayout documentation for more details.
The source layouts are located in:
The JLayout path that you may want to override are the following ones:
com_sh404sef.analytics.snippet_ga4 com_sh404sef.analytics.snippet_uga com_sh404sef.analytics.snippet_gtm