To ease the analysis of content on a multi-lingual site, we want to track a generic language-independent URL into the PP standard URL dimension.
I am probably blind, but I cannot find a way to set the URL in the Piwik Pro (“tracking code”) Tag.
If I use a virtual Pageview tag to set the URL, I can set a Custom URL, but then I have duplicate pageviews (one from the “tracking code” Tag, one from the vritual Pageview Tag).
I followed the guide here:
But to no avail.
If I check “Track page views manually”, my expectation would be that NO automatic Pageviews would be fired anymore, i.e. everything becomes manual. But for whatever reason, Piwik thinks it still needs to fire that initial pageview. Is this a bug or “as designed”, or am I not seeing the obvious?
Removing the trigger for the “tracking code” tag also didn’t help. Then nothing is fired at all anymore.
In general, PP has to separate the general configuration of PP Analytics from the firing of PP tracking events - similar to how Google did it with the Configuration Variable for GA3. Bundling a pageview Event into the configuration tag that you cannot disable is not a good idea.
This is such a common use case, can’t be that hard. So thanks for any help.
If you want to keep the automatic page view tracking and have a custom URL then probably the best way would be to create a custom HTML tag, add the setCustomUrl function to it (e.g. _paq.push(["setCustomUrl",{{ my custom url }}]);) and set a higher priority for the tag that’s using setCustomUrl (Tag Manager > Settings > Tag priority), so it’s triggered before the Piwik PRO tag.
No, you are not blind. There’s no way to set a custom URL inside the Piwik PRO tag .
You are correct. Once you enable Track page views manually the trackPageView function should be removed from your tracking code (the Piwik PRO tag). Is this also occuring in incognito?
Boy, that is dirty… PP can’t be serious!
How safe is the priority thing in PP? In GTM and Launch, priority does not guarantee tags to finish before tags with lower priorities are started, as it is all asynchronous. The only guarantee is that tags with higher priority are STARTED before those with lower prio. Can I somehow be 100% sure that the order won’t be messed up?
“You are correct. Once you enable Track page views manually the trackPageView function should be removed from your tracking code (the Piwik PRO tag). Is this also occuring in incognito?”
=> I may have been misinterpreting the PP requests. Is there a Cheat sheet to understand the request parameters better?
If there is ping in the request, it probably is a heartbeat request?
I’ll file a feature request for this as it would be best to include it directly in the tracking code. This is possible right now but you would have to ditch using the Piwik PRO tag template and use a custom HTML tag instead - not ideal for sure.
Can’t really comment about the overall safety as it would probably depend on the case. I have used this method of overwriting the default URL a couple of times and it worked fine. You are right that in some cases it could lead to race conditions as it’s indeed still asynchronous.
If you’d still want to use it, it would probably look something like this:
<script>
var _paq = _paq || [];
_paq.push(["setCustomUrl", {{ My custom URL}} ]);
</script>
The _paq command queue (var _paq = _paq || [];) is defined here because we are using it before the tracker is added to the website.
There’s actually a couple of ping types. The documentation you will probably find most useful would be:
Thanks. Yes, please file that request. It should not be necessary to go into “manual tracking mode” or add dirty HTML tags just to track a custom URL and Title…
Hi, if I understand correctly your issue, we solved this linking the pageview with a dataLayer event, and set the pageview for the url with the event. I explain it with an example:
we have:
URL: yoururl.com
virtualURL: yoururl.com/virtual
so you would have 2 pageviews here;
we did something like:
URL: yoururl.com
event: trackview
virtualURL: yoururl.com/virtual
and with the tag manager we set the pageview “virtualURL” where the condition is “event is trackview”. So it would be tracked only the 1 view of “virtualURL”
“event: trackview” is gonna be a dataLayer event
“virtualURL” is a js variable that you create with your desired value
Thanks, yes, this is the method I mention with “If I use a virtual Pageview tag to set the URL, I can set a Custom URL”. This is a valid way to do it for Single-Page Apps, but I find it suboptimal that you cannot set a Custom URL / Title via the regular Piwik Pro tag.