Back to blog

How to Implement Piwik content tracking via Piwik PRO Tag Manager

Tag Manager Use cases

Written by

Published June 18, 2016 · Updated August 24, 2018

Why would you need content tracking?

Let’s say that you have a long landing page and you are wondering if visitors are even looking at the lower parts of the content. In a basic mode, Piwik web analytics tracks the number of pageviews, but does not track percentage of content that was displayed during the pageview.

This is where we can use the content tracking feature to check if our content is being read by our visitors.

To implement this option, we need to configure some additional elements in the source HTML of our page and add implement the appropriate Piwik features via Piwik PRO Tag Manager.

Free Comparison of 6 Enterprise-Ready Tag Management Systems

Get to know the 40 key differences between Google Tag Manager, Tealium, Segment, Adobe Marketing Cloud, Ensighten & Piwik PRO:

Download FREE Ebook

HTML configuration

Before we begin, we should mention a little bit about Content Name and Content Piece and what these terms mean:

  • Content Name refers to a batch of the content we want to track.
  • Content Piece refers to one of the elements of the Content tracking.

Data about both of these is stored in the Contents report which can be found in under the Actions option in the main menu.

In our example, we want to define two content pieces of which the first is followed by the second. The first piece will be called 1st set and the second one accordingly 2nd set. Both content pieces will be under one Content Name On-Premises LP Features.

All the details of the implementation can be found on the following screen:

HTML code of the tested elements
HTML code of the tested elements

You can find more information about the Content Tracking implementation HERE

To help Piwik recognize these HTML elements, we need to add some things into the Piwik code. We will do this using Piwik PRO Tag Manager.

Piwik PRO Tag Manager Configuration

There are two main types of the content tracking, and each one is strictly related to the method which we are using:

  • tracks all content blocks
  • _paq.push(['trackAllContentImpressions']);

  • tracks only visible content blocks
  • _paq.push(['trackVisibleContentImpressions']);

We will use this one because we want to know if our content is visible for users or not.

We can implement the correct option in two ways. It all depends on how we have implemented our main Piwik code.

Non-template Piwik implementation

If you have implemented your Piwik using an Asynchronous custom HTML tag you have only to add one line to the code – as follows:

Extended Piwik PRO code
Extended Piwik PRO code

Template Piwik implementation

This method has a one major advantage – we can easily execute additional functions on specific pages without affecting the whole website as we would with the main code. So, if you are using a Piwik template:

Choosing Piwik template
Choosing Piwik template

you have to create a new tag to insert additional snippet into the code.

We start with the + Add a tag button:

Piwik PRO Tag Manager - adding a tag
Piwik PRO Tag Manager - adding a tag

Now we configure the content of the tag. In the Tag HTML field we paste the afore-mentioned code line but within the script tags. Here is a bit of code for pasting:


It should look like this in the Piwik PRO Tag Manager configuration panel:

Configuring additional Piwik code
Configuring additional Piwik code

After this, we have to configure a trigger which will determine when the tag will fire. Like before we can decide whether we want to execute this snippet across the whole website or on only pages which we intend to monitor. We have decided to fire this tag only on the landing page in question. Because of this, the trigger configuration should be following:

  1. We set an easily recognizable Trigger Name.
  2. We have choosen Page View from the Loads on and On state menu.
  3. We have set the correct Condition for a trigger – Page URL contains “on-premises-self-hosted-enterprise-web-analytics” because the URL of the landing page is
Trigger configuration
Trigger configuration

We have saved the trigger configuration by clicking Add and Save after that.

To make our tag go live with the latest changes we click Publish

Publishing last changes
Publishing last changes

Piwik Report

Now we have to check our report to see if any new data came in to Piwik. We go to the Contents report under the Actions main menu option (read more about if from Actions Reports User Guide):

Content tracking reports in Piwik PRO
Content tracking reports in Piwik PRO

As you can see, we now have new data about our content pieces.

Free Comparison of 6 Enterprise-Ready Tag Management Systems

Get to know the 40 key differences between Google Tag Manager, Tealium, Segment, Adobe Marketing Cloud, Ensighten & Piwik PRO:

Download FREE Ebook


Szymon Grzesiak

Performance Marketing Manager

Marketing expert with over 8 year experience in SEO and SEM campaigns. Last years mostly worked on the B2B lead aqcuisition. Wordpress webmaster with HTML and CSS knowledge. LinkedIn Profile

See more posts by this author

Core – a new plan for Piwik PRO Analytics Suite

Privacy-compliant analytics, built-in consent management and EU hosting. For free.

Sign up for free

 Free Comparison of 5 Enterprise-Ready Tag Management Systems
Upcoming live webinar

August 3, 2021

Data analytics in healthcare – do more with patient data while staying HIPAA-compliant

In the healthcare industry, one of the main challenges is balancing data collection with HIPAA compliance. Join the webinar and learn how to run solid analyses and move past barriers that hinder the use of data in healthcare. You’ll also get a grasp of how to use first-party data to boost your organization’s tech advancement. Piwik PRO and Blast Analytics, experts in the field, will be your hosts. Sign up below and remember to stay for the Q&A session at the end.

Sign up for this webinar