I am a little confused on how to go about tracking ajax requests with Piwik. I am using jQuery to ajax in content from other content pages I have in a /pages directory onto my main index page. I found a post on piwik-hackers about someone trying to do this with the old javascript tracking code. He claimed he got it to work by including the piwik tracking code in the html that was ajaxed in. When I try this however, my page gets stuck loading and eventually firebug gives me a “too much recursion” error.
Lately I have been trying to execute trackPageView function within the ajax function I use to call the content pages, but have only been successful in recording pageviews for the index page, and not the content page which was ajaxed. There seems to be a lack of documentation on tracking ajax requests, so I am at a loss.
Has anyone successfully implemented the tracking of ajax requests with piwik, and if so, how did you pull it off?
I’ve tried to use trackLink() to log ajax calls but (correct me if I’m wrong) I have only the choice between ‘link’ and 'download" as linkType.
I would prefer to log these calls as standard “page views” with a specific url (instead of the regular document’s url). Is there a trick to do that ?