[ANSWERED] Custom url as pageView


Is it an idea to create an option to customize the urls that gets logged. So instead of just calling piwikTracker.trackPageView() piwikTracker.trackPageView(url).

Hope you’ll like this, and implement it style_emoticons/<#EMO_DIR#>/smile.gif

Is this really needed ?
We can set the page title and the url of the page that is currently running the Piwik script is “captured” automatically by Piwik and that include URL that have been constructed by the server rewrite engine.

For exemple, say you have a site that do all it’s magic using only a single index.php file at the root and with some parameters like that :

http:/ /domain.com/index.php?action=search&key=test

The URL could easilly become :

http:/ /domain.com/index.php/search/test

using the rewrite engine.

Actually because I only have an index.php. See this: http:/ /www.google.com/support/googleanalytics/bin/answer.py?answer=55576

You can already use:

  • trackPageView(customTitle)
  • setCustomUrl(customUrl)
  • setDocumentTitle(customTitle)

Thanks Vipsoft for that answer, my preceeding reply was mainly because i didn’t found that information in the docs/faq pages.

Silly me !
I was already using the setCustomUrl in my 404.htm file !
Full line :

piwikTracker.setCustomUrl('404/URL = '+encodeURIComponent(document.location.pathname+document.location.search) + '/From = ’ + encodeURIComponent(document.referrer));