Ralph

Piwik: Tracking HTTP/HTTPS Visits

Introduction

user

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.


LATEST POSTS

The whole system that we live in drills into us… 23rd September, 2018

Canvas LMS: Install QTI Migration Tool 08th August, 2017

General

Piwik: Tracking HTTP/HTTPS Visits

Posted on .

For web administrators that rely on Piwik for analytics, if you’ve tried to track a HTTPS URL from a non-HTTPS installation of Piwik, you will notice that visits to the HTTPS page(s) will not be logged to your non-HTTPS piwik installation. This is because all resources (such as the requests to Piwik) of the site requested through HTTPS have to use the same protocol.

To alleviate the problem, your Piwik installation has to be available via SSL. The Piwik Javascript snipped already checks the protocol and redirects the user to the respective protocol. Now all you need to ensure is that your Piwik installation resides somewhere that has a valid SSL certificate.

In my case, I had the non-HTTPS installation tracking a bunch of non-HTTPS pages and I didn’t want to break Piwik tracking in these other pages or relocate the installation. To fix this, I installed another copy of Piwik on the HTTPS/SSL enabled website and connected the installation to the existing non-HTTPS installation’s database. Currently, both installations correctly track hits and report them to the same database so I can continue tracking all my website, HTTP/HTTPS from a single installation. Just remember to use the SSL enabled Piwik installation’s tracking code on your HTTPS pages.

profile

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.

Navigation