Remove parts of the URL being tracked

We are trying out Piwik in a Websphere Portal site, and want to remove everything after /!ut/ to not be tracked, since it contains session and portlet state information.

I read on the forums that it would be possible to use: piwikTracker.setCustomUrl(‘’); But it looks like this is through the use of the API. I am using the following script instead:

var _paq = _paq || [];
<portal-logic:if loggedIn="yes">
<c:set var="mail"><portal-fmt:user attribute="mail"/></c:set>
_paq.push(['setUserId', '${mail}']);
(function() {
  var u="//";
  _paq.push(['setTrackerUrl', u+'piwik.php']);
  _paq.push(['setSiteId', 1]);
  var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
  g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);

How to include this param in the _paq.push variable?

Hi, you simply need to add a line like this:
_paq.push([‘setCustomUrl’, ‘’]);
before the trackPageView line so your code should look something like this:

var _paq = _paq || ;
<portal-logic:if loggedIn=“yes”>
<c:set var=“mail”><portal-fmt:user attribute=“mail”/></c:set>
_paq.push([‘setUserId’, ‘${mail}’]);
(function() {
var u=“//”;
_paq.push([‘setTrackerUrl’, u+‘piwik.php’]);
_paq.push([‘setSiteId’, 1]);
var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0];
g.type=‘text/javascript’; g.async=true; g.defer=true; g.src=u+‘piwik.js’; s.parentNode.insertBefore(g,s);

There is a nice article describing this in detail here:

1 Like

Thanks, this was what I was looking for :slightly_smiling: