Implement Piwik manual goal conversion tracking with Piwik PRO Tag Manager
Author Szymon Grzesiak
Author Szymon Grzesiak
Conversion tracking is the heart of web analytics. Even the most basic analysis is useless without it. Tracking goals to draw conclusions is why we have web analytics reports. Just looking through raw data and metrics without having any defined goals is pointless.
In Piwik you can configure your conversion goals in multiple ways:
In other words, a conversion goal is triggered when:
But there is another way to configure a goal – manually.
Here is where you would choose the following option:
This allows you to insert a trackGoal() function wherever you want.
Let’s say we are interested in tracking users who click on our Polish telephone number on the piwik.pro website. This means we want to collect information in our Visitor Log that specific user clicked on the number.
We have to implement this goal manually because there is no other way to set this automatically. Of course, this is a link, but it leads to the URL callto:+442033182881 which means it is not a static page where we could put our tracking code.
To begin with we have to configure a Goal in our Piwik platform. To do this we go to the Manage Goals menu in the main menu (you can learn more about goals from our User Guide):
Then of course we have to Add a New Goal by clicking on:
The next step is the configuration of the goal itself. Firstly, we have to set a recognizable Goal Name (1), then choose the manually (2) option from the dropdown menu under Goal is triggered.
After that, depending on our expectation, we can set that goal to be converted one or more times during a session. We want to observe all the phone number clicks, so we select the Allow Goal to be converted more than once per visit (3) option:
Finally, after configuring our new goal, we just have to click on Add Goal.
The next very important step is to check what ID our new goal has. We will need this number to correctly configure goal tracking in Piwik PRO Tag Manager. After saving the goal we see the list of all our goals. Go to the bottom of the list and find the newly added goal:
We have our ID – in our case it is 24.
So – we have configured our goal in Piwik (remember the ID) and now we have to help our website send Piwik the relevant information we hope to generate. To do this, we can use Piwik PRO Tag Manager for a smooth, easy experience that doesn’t involve our IT department and a lot of messy coding.
Firstly, we add a new tag:
Within the tag configuration we have couple of steps:
1. Set the Tag Name which will be easily recognizable
2. Choose the Asynchronous custom HTML tag option:
3. Now we have to insert the code which will provide Piwik with the correct information into the Tag HTML field:
Here you can copy the code which we are using – notice that we’ve used our goal ID (24). It is important to use your goal’s ID in order to make it work.
4 . Now the second most important part (after inserting the proper code). We have to correctly trigger this goal at the right moment. As we said at the beginning, we want to track Clicks on phone number link, so:
4.1. Set a Trigger Name which will be easy to identify.
4.2. Choose Click as the form of loading the tag.
4.3. Choose Click Url to identify right link on the page. Set the value to: equals callto:+442033182881. Why? Because our website doesn’t have any ID or classes on this HTML element, we have to distinguish this particular link via its href value.
4.4. To be sure that we are talking about Contact page we add the next condition Page Url with the value of: contains contact.
5. Click Save for the trigger and again Save for the whole tag.
Now the configuration is done, so it is time to track this new goal in our Piwik reports. For us the most useful place to track this goal is in the Visitor Log. We can easily distinguish all the visitors who have clicked on our phone number:
The goal is duplicated because the phone number was clicked twice – which only confirms the success of our Piwik goal configuration.
Get to know the 40 key differences between Google Tag Manager, Tealium, Adobe Dynamic Tag Management, Ensighten & Piwik PRO:Download FREE Ebook