Changing conversion attribution from last to first click with Piwik PRO Tag Manager
Author Szymon Grzesiak
Author Szymon Grzesiak
First, we should explain how Piwik goal tracking works (and you can learn more about it from our Goals User Guide) To quote a FAQ entry from the Piwik website:
When visitors convert a Goal, Piwik tries to attribute the conversion to the referrer that brought the visit to the site. Piwik will credit this Goal conversion to the last non empty referrer used by the visitor (ie. the last time the visitor came to the website with a referrer that was not a direct entry).
But what if we want to know which source and medium was responsible for acquiring visitors who converted? We can easily tell Piwik to track the referrer which was first in a conversion process. To do this we just need to add one specific line to the main Piwik code. Let’s see how we can do this quickly via Piwik PRO Tag Manager.
This modification requires you to manually alter the main Piwik code, not via a Piwik template. Why? Because this additional line of code has to be called BEFORE calling out with the trackPageView() method.
Note: if you have implemented the Piwik integration with a tag template skip to the next chapter.
Let’s set this up. Go to your Tag with the Piwik main code and add this line
To picture this, check out the screen below:
To implement this feature, we have to switch to code manual insertion. To do this find a Tag with your Piwik main implementation:
And click on the name – in this case it’s Piwik Pro.
To change the type of tag Click on the Asynchronous custom HTML tag.
In the Tag HTML field we have to paste the Piwik Code. It can be found in the Piwik platform Administration panel (1) under Administration and Websites (2). Just find your website and click on the link called: View Tracking Code (3).
On the next screen, the tracking code is visible and ready to copy & paste into Tag HTML field. This is the best time to add additional line in question:
Remember that it must be pasted before
Lets check out the screen below with featured already inserted:
When it comes to the trigger configuration, we don’t want to change anything – the Piwik main integration should fire on every page. The configuration of the Trigger should look like this:
Now Save all changes and Publish the updated tag into the world:
From now on, Piwik will report the first referrer in all goal reports.
As you can see, these kinds of changes can be implemented quite quickly and easily when we are using the Piwik PRO Tag Manager. We don’t have to bother an IT team member extra tasks and wait ages for their response. So be sure to check out our Tag Manager User Guides to learn more.
Get to know the 40 key differences between Google Tag Manager, Tealium, Adobe Dynamic Tag Management, Ensighten & Piwik PRO:Download FREE Ebook