Mooash
(James)
January 14, 2013, 10:34pm
#1
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!
matthieu
(Matthieu Aubry)
January 15, 2013, 3:59pm
#2
What is full code you used?
Mooash
(James)
January 15, 2013, 9:42pm
#3
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 -->
matthieu
(Matthieu Aubry)
January 16, 2013, 12:25am
#4
It should work, can you try in a simple HTML page, does it work in this simple use case ?
Mooash
(James)
January 16, 2013, 4:30am
#5
It seems to work fine in a HTML page. I’ll put my old code in again and see if it works.