How to track LIMS portal usage with Google Analytics
This How-to applies to: Any version.
First step is to sign up with Google Analytics at www.google.com/analytics and create a web site 'profile' to track the site with. At the writing of this, the service is offered for free and the above page offers substantial information on how to utilise it
Then,
Install your tracking code
To access your tracking code
- Sign in to Google Analytics
- From the Analytics Settings page, find the profile for which you would like to retrieve the tracking code. Note that tracking code is profile-specific
- From that profile's Settings column, click Edit
- At the top right of the Main Website Profile Information box, click Check Status
- Your tracking code can be copied and pasted from the text box in the Instructions for adding tracking section
Installation
The tracking code segment must be copied into the bottom of your content immediately before the </body> tag of each page you are planning to track. To track all Bika pages, we do this via a once-off installation in the main system template
- Log in as portal administrator
- Navigate to the Zope Management Interface from the Site Setup page
- Click on your Bika folder
- Click the Plone Skins Tool (portal_skins)
- Click plone_templates. You should then be in the folder /your_bika_folder/portal_skins/plone_templates
- Click main_template
- Click the [customise] button to edit the template
- Insert the tracking code from Google Analytics at the bottom of the page just before </body> tag
- Click [Save Changes]
- The customised template is now saved to /portal_skins/custom/main_template and all visits to the portal will be tracked by Google Analytics from where you may analyse the traffic
Exclude internal traffic
If you want to exclude internal traffic from appearing in your reports, you can filter out a specific IP address or a range of IP addresses. You can also use cookies to filter out visits from particular users
These are described in details on the Analytics help pages and we'll cover only the most likely instance, excluding internal traffic by IP address here:
- Click Filter Manager from the Analytics Settings page
- Enter a Filter Name for this filter
- From the Filter Type drop-down list, select Exclude all traffic from an IP address
- The IP address field will auto-populate with an example IP address. Enter the correct value. Remember to use regular expressions when entering any IP address. For example, if the IP address to filter is 176.168.1.1, then the IP address value will be 176\.168\.1\.1
- Select the profiles to which this filter should be applied in the Available Website Profiles box
- Click Add to move the selected profiles into the Selected Website Profiles list
- Click Finish to save this filter, or Cancel to return to the previous page