One of the things that make a modern web analytics tool handy is the fact that it does just about everything for you, without much intervention. But there are times you may need to set data manually, just like we did for the page name.
If you want, you can override a tracked page's reported URL. Maybe the URL you present to the world has been made pretty with a mod rewrite for SEO's purpose, and the actual query string version of the URL and its parameters is more useful information. Sometimes, the dirty version of a URL will have category information and similar data. If this is necessary, you can do this using:
... piwikTracker.setCustomUrl('http://mydomain/customurl.php'); piwikTracker.trackPageView(); ...
Note
setCustomUrl(string)
: This function overrides the tracked page's reported URL with the value in the parameter string
.
You can override the referrer URL with a similar method.