Manual tracking not generating data

Reffering to method mentioned here: http://piwik.org/docs/javascript-tracking/#toc-manually-trigger-a-page-view-on-click-or-on-js-event

Also found this: Troubleshooting - Analytics Platform - Matomo

I see data from page views from standard JS tracking code, but not the manual code, disabled adblocking, tested across multiple browsers and devices.

I am using jQuery function to to trigger tracking function when clicking on menu items:


jQuery("#menu-custon_menu a").click(function() {
	var pagename = $(this.hash).replace("#-", "");
	piwikTracker.trackPageView("Menu-"+pagename);
});

Replacing “piwikTracker.trackPageView” with “console.log” outputs the custom page title fine to the web console.

use the asynchronous version, it will work then: http://piwik.org/docs/javascript-tracking/#toc-asynchronous-tracking

the problem is most likely that piwikTracker is not defined yet when the click occurs

Thanks so much for the quick reply.

It turns out it may have been the reports I was viewing. I had current day as date range however nothing was showing up it seemed.

When I changed date range to wider range those clicks showed up. Also interesting to note that those clicks dont show up under “pages” in activities but under “page titles”.

Thanks again, piwik is a great tool, we will be using it as our primary analytics tool for hopefully some time to come.