Liferay DXP and Analytics

Liferay Integration with Analytics

1) With Google Analytics

Set up an account with Google Analytics: https://analytics.google.com/

This will create a Tracking Id

 

Configure the Tracking ID In liferay Configuration --> Site Settings --> Analytics

A Tracking Code will be generated which can then pasted in JavaScript of the Liferay Pages which needs the tracking. JavaScript code can be added under Configure section of Public or Private Page

Once down different analytics information start getting records on the Google Analytics 

Page Views Graph

 

Page View Statistics

 


2) With Piwik

For the Installation of Piwik ,

a) First Download XAMPP.  This bundle will have Apache , PHP , MySQL etc. Install the XAMPP

b) Also download piwik from https://piwik.org/download/ .    

Once the XAMPP set up is completed and apache and mySQL Services are running.  Copy the unzipped piwik folder to the htdocs ( so evntually it will be \xampp\htdocs\piwik)

You can now browse piwik using http://ip/piwik and can start the installation.

 

During the process set the piwik admin user and complete the installation.

 

Piwik will generate a tracking code which will be used to be configured in Liferay

 

Paste the Tracking code under Configuration  --> Site Settings --> Analytics --> Piwik

 

Once done , browse different pages and you will notice analytics on piwik dashboard.

Dashboard 1

 

Dashboard 2

Blogs
Hi Sandeep,
The standard Piwik tracking code doesn't work properly with single page applications (it doesn't track page changes). What did you do to make it work properly with Liferay DXP?

Regards,
KG