Issue setting page URL in tracker

I’m trying to force the Piwik tracker to record a URL as what I set in the track script, so that it doesn’t record any of the session data or any other variables as they often change randomly.

I’ve tried putting piwikTracker.setCustomUrl(‘https://example.com/browse.php’); after var piwikTracker = Piwik.getTracker(pkBaseURL + “piwik.php”, 23); however the page is still recorded as https://example.com/browse.php?u=blahblahblah&b=12

Any idea how I can force the URL to be recorded as just https://example.com/browse.php ?

Thanks for any help!

What is full code you used?

I’m using the basic tracking script but with the addition I mentioned above.


<!-- Piwik --> 
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.eample.com/" : "http://stats.example.com/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 3);
piwikTracker.setCustomUrl('http://yoursite.com/browse.php'); 
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://stats.example.com/piwik.php?idsite=3" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

It should work, can you try in a simple HTML page, does it work in this simple use case ?

It seems to work fine in a HTML page. I’ll put my old code in again and see if it works.