How to set custom url in web app (for SmartTV)


I am currently having trouble getting Piwik to record a custom URL. In the Piwik Dashboard when looking at the visitor profile I am receiving the data for the document title but underneath it am being shown ‘Page URL not defined’.

I can see in the developer tools Network window that ‘action_name’ is being populated by my page title and that ‘url’ is being populated with my custom URL but the custom URL is not being displayed in the dashboard.

The app I am developing is for Smart TV so the ‘url’ variable in the tracking request is being pre-pended with the protocol ‘file:///’ in the developer tools Network tab. Is it this that might be causing the URL to not reach the dashboard?

Any help in the right direction would be much appreciated! Thanks very much.

In index.html:

<script type="text/javascript">
  var _paq = _paq || [];
  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "mySiteId"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);

In my respective subpages:

_paq.push(['setCustomUrl', 'customHomepageURL']);
_paq.push(['setDocumentTitle', 'Homepage']);

Query String Parameters sent to Piwik:


In the Piwik Dashboard (visitor profile):

  1. Homepage
    Page URL not defined

(Matthieu Aubry) #2

Hi there, when definining a custom URL please make sure it looks like a URL such as http://customurl/page



Thank you very much. That works perfectly and thanks for Piwik!