How to Implement Piwik content tracking via Piwik PRO Tag Manager
Author Szymon Grzesiak
Author Szymon Grzesiak
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.
Before we begin, we should mention a little bit about Content Name and Content Piece and what these terms mean:
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:
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.
There are two main types of the content tracking, and each one is strictly related to the method which we are using:
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.
If you have implemented your Piwik using an Asynchronous custom HTML tag you have only to add one line to the code – as follows:
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:
you have to create a new tag to insert additional snippet into the code.
We start with the + Add a tag button:
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:
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:
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
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):
As you can see, we now have new data about our content pieces.
Get to know the 40 key differences between Google Tag Manager, Tealium, Adobe Dynamic Tag Management, Ensighten & Piwik PRO:Download FREE Ebook