How to track the pages build with JQuery

How can we track the pages of a mobile website build with jQuery

Trying with both scripts The initial one and the Asynchronous one, only the index page appears in the dashboard.

The different titles of the content are not picked up by the tracking code even if they appear in the title of the page.

Is there a way to track the different H1 tags as all the content is on one page and jQuery pulls the content by calling a # tag.

I hope this is clear enough as I’m not English speaker.

Any help will be very much appreciated.

You can use piwikTracker.setDocumentTitle( “New title here” )

to specify which “page title” should piwik use.

Hi Matt, thanks for the answer.

Where do you put the [quote=piwikTracker.setDocumentTitle(New title here)]
[/quote] and what do you put in “New Title here”

When I use the 1st tracking code in the Doc with the

[quote="[…] piwikTracker.setDocumentTitle(document.title);
piwikTracker.trackPageView(); […]"]
The tracking code picks up only the title of the privacy policy content located at the bottom of the index page which is the last

tag of the content.

When I use the Asynchronuus code, piwik only picks up the the title of the page set in the tag of between the tags of the document.but not the


set for in the page and pulled in by a php call [quote="<?php echo $$PageNum; ?>"][/quote] whch “print” the name of the title of the “page” content.
I’ve tried to put this php code in the header of the page like this:

[quote="<?php echo $$BusinessName ?> | <?php echo $$PageNum; ?>"][/quote]
The business name works, but the PageNum tag cause a php error.

So I don’t know how to get that working.

Thanks for your time and your help


The title is what is between the

otherwise try something like: piwikTracker.setDocumentTitle(jQuery(‘h1’).text().trim())