Implementing Piwik Virtual Page Views with Piwik PRO Tag Manager

Published: June 17, 2016 Updated: April 19, 2019 Author Category Tag Manager, Use cases

What are virtual page views and why would you need them?

Virtual pages in web analytics reports (in Piwik nomenclature – custom URL) is very useful feature. In essence, it refers to tracking a physically nonexistent URL which is used only for reporting. Let’s look at some examples of this:

  • Dynamic reload after form completion – after filling out a form a user stays on the same URL which means you aren’t be able to track this action with your web analytics platform. To deal with this, we can create a unique virtual URL (anyone you want) and set it as a goal URL after a successful form completion. You can also set up an event, but unfortunately it can’t be used in funnel configuration.
  • Links to other domain websites – you can measure traffic from other domains (unless is it yours too) so clicks to, for example, your Facebook fanpage can be tracked as example.com/facebook-fanpage URL in your analytics.

In order to illustrate this use case, we will create the custom URL:
cloud.piwik.pro/register

This page will be virtually created after someone clicks the Sign Up button on the top of the page:

Piwik PRO Cloud Website
Piwik PRO Cloud Website

Piwik PRO Tag Manager Configuration

To configure this custom URL to be visible in a Piwik report, we have to execute appropriate functions and pass the information to Piwik. To accomplish this, we first have to configure a tag by clicking + Add a tag:

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

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

Now we can start the tag configuration itself. To start with it, it’s a good idea to select an easily recognizable Tag name (1) and choose the Asynchronous custom HTML tag (2) option from the templates:

Choosing tag template
Choosing tag template

Now, the most important and advanced step – code insertion. First let’s take a look at the code for a while:

<script><br />
_paq.push(['setDocumentTitle', 'Sign Up Page']);<br />
_paq.push(['setCustomUrl', 'https://cloud.piwik.pro/register']);<br />
_paq.push(['trackPageView']);<br />
</script>

The second line (just after <script> tag) is responsible for setting the Custom page title which will be visible in Piwik reports. While this is optional, it is recommended. The third line is the key part of our operation – we are defining the custom URL which will be visible in Piwik’s Pages report. Note that it is a full website URL and only specific page (register) is virtual. We can insert any page name we want, but using an already existing page name could, of course, disrupt our reports.

So the configuration of this step should look like this:

Piwik custom URL configuration
Piwik custom URL configuration

After setting up the code itself, we have to fire the tag at the correct moment. In this case we need to define the tag’s trigger as the click of the Sign Up button in head bar.

Let’s set a specific Trigger name (1), choose Click (2) as the method of loading our tag and set up Conditions (3). The condition which we will use is the snippet we have grabbed from the HTML code of this button:

Piwik PRO Cloud Sign Up button - HTML code
Piwik PRO Cloud Sign Up button - HTML code

The complete trigger configuration is presented here:

Trigger configuration - Click on the Sign Up button
Trigger configuration - Click on the Sign Up button

Click Add to save the new trigger, and then Save to save whole tag configuration. And if you’d like to learn more about the usefulness of tag manager, be sure to check our Tag Manager User Guides.

Reviewing Piwik Reports

OK, we have our new functionality working and now we should be able to view new information gathered with the this tag in Piwik reports. We can do this in multiple places – the most obvious of which are Pages and Page Titles reports:

Pages report
Pages report
Page Titles report
Page Titles report

But, of course, this data should also be available in Visitors Log – and it is:

Piwik Visitors log
Piwik Visitors log

Notice that on the last screen we see a Goal completion called Menu Bar Sign Up which refers to the same action as our new virtual page. This is indeed the same action and this goal was configured earlier. We show this to present different ways to use goals.

Having a new, separate and unique URL available in Piwik reports you can now easily create a new goal based on this URL, use this URL in your funnels or just track stats for this object.

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

Tagged under

Author:

Szymon Grzesiak, Marketing Tech Lead

Tech savvy Performance Marketing Specialist. LinkedIn Profile

See more posts of this author
Free Comparison of 5 Enterprise-Ready Tag Management Systems

Share