Display title pages (Joomla)


(LupusCramus) #1

Hello !

First, I precise I’m french, so my english could be average… sorry.

I make a site with Joomla, and I’ve setup the plugin which include the tracker.
In piwik, in actions->page, I’d like see the title of page instead their url.

I’ve read the doc with the javascript, but there is no effect.

Must I modified the plugin or the tracker in the folder piwik/core/tracker ?
And how ?

Thanks of your help.

Bye.


(LupusCramus) #2

Hello

I’m sorry for the double-post, but I have not had response.
Someone would have an idea, or need more precisions ?

Thank you for your help


(vipsoft) #3

Did you refer to the “Docs” link? I’m pretty sure the JavaScript tracking API is documented there… http://piwik.org/docs/javascript-tracking/

i.e., setDocumentTitle()


(jonpaul) #4

Excellent link from vipsoft will really expand on this feature.
Modifying the plugin was easier than expected. Thanks!


(LupusCramus) #5

Hello !

Sorry for the latency, there were other projects more urgency for the website.
For that, I use the CMS Joomla, and there is a plugin for implement piwik in Joomla.

Here is the tracker :

$piwik_javascript = '
            <!-- Piwik -->
            <a href="http://piwik.org" title="Web analytics api" onclick="window.open(this.href);return(false);">
            <script type="text/javascript">
            var pkBaseURL = (("https:" == document.location.protocol) ? "'.$piwik_https_url.'" : "'.$piwik_http_url.'");
            document.write(unescape("%3Cscript src=\'" + pkBaseURL + "piwik.js\' type=\'text/javascript\'%3E%3C/script%3E"));
            piwikTracker.setDocumentTitle(document.title);
            </script><script type="text/javascript">
            piwik_action_name = \'\';
            piwik_idsite = '.$piwik_site_id.';
            piwik_url = pkBaseURL + "piwik.php";
            piwik_log(piwik_action_name, piwik_idsite, piwik_url);
            </script>
            <object><noscript><p>Web analytics api <img src="'.$piwik_http_url.'piwik.php" style="border:0" alt=""/></p></noscript></object></a>
            <!-- End Piwik Tag -->
            ';

In this, I don’t know where I must modify the tracker for put title instead of url in actions->pages

Could someone help me, please ?
Thanks.


(vipsoft) #6

In the legacy tracking code, set piwik_action_name. With the new API, use tracker.setDocumentTitle().

In 0.5, this will default to the page title. URLs and page titles will be displayed in separate widgets.


(LupusCramus) #7

Hello,

I’ve replaced

 piwikTracker.setDocumentTitle(document.title);

by

tracker.setDocumentTitle()

and it doesn’t work (I’ve URL instead of name of pages).
I use the 0.4.5 piwik version.

Thanks for your help


(vipsoft) #8

I wasn’t suggesting code…I was pointing out the method signature.

Don’t mix the new API and legacy tracking code. Choose one or the other.

Or wait for 0.5 … a release candidate is expected real soon now…