For certain page paths, it looks like the trailing comma is being removed sometimes but not others. For example:
Is there any way to combine page paths like this so it only shows page paths either with trailing slashes or without?
For certain page paths, it looks like the trailing comma is being removed sometimes but not others. For example:
Is there any way to combine page paths like this so it only shows page paths either with trailing slashes or without?
Hi @Rachel_Witner,
Short answer: It’s not possible to change values of dimensions after they were already tracked, but it’s possible to add/remove the slash before sending the data to Piwik PRO.
Why slashes appear sometimes and sometimes they don’t: Both /fragrance-oil-finder
and /fragrance-oil-finder/
will point to the same page on your website, because of that visitors sometimes will use one and sometimes the other one. To minimize the usage of one of them you have to make sure that all links in your website use particular standard either ending the path with “/” or without it.
How to send data to Piwik PRO with particular standard: With custom setup it’s possible to check each URL and remove the slash or add it (depending on what standard you’d like to use) before sending the tracking request.
Here’s how to achieve that (solution for adding missing “/” at the end):
Go to Menu → Tag Manager → Tags
Click on Add a tag
and give it a name.
Select Custom code (async)
and click Next
Use this script:
<script>
var _paq = _paq || [];
(function(){
var urlArr = {{ Page Url }}.split("?");
if(urlArr[0].slice(-1) !== "/") urlArr[0] += "/";
if(urlArr.length > 1) _paq.push(["setCustomUrl", urlArr[0] + "?" + urlArr[1]]);
else _paq.push(["setCustomUrl", urlArr[0]]);
})();
</script>
Choose existing trigger
and select the All page views triggerOK
button.This solution will work only on new data and will not change the already gathered one.
Best,
Oliwer