PHP and Javascript Intergration


Hi Guys

I am looking to use piwik for the websites I manage instead of Google analytics. I just have a few questions about integration of the tracking api that I hope someone can answer for me.

For one of my websites which is an eCommerce website using a custom made CMS I am thinking that the PHP integration might be better than javascript - i feel it will get more accurate results and tracking sales, abandoned carts and search will also be more accurate - I suppose my first question is is this correct? Would I get the same or better features using PHP over Javascript?

My second question is would I be able to use PHP tracking on some parts of my website (the main ecommerce) and javascript on other parts (I use a couple of external scripts (on the same domain) for things like surveys, competitions and affiliate programs that I would like to track) or would I have to integrate the tracking api using the same method throughout the whole website?

Thank you in advance


(Matthieu Aubry) #2

You can use different methods ie. use JS and PHP tracker at the same time. The key thing to do is to keep track of the visitor ID in Javascript (via calling getVisitorId on JS) for a visitor and then set it again using setVisitorId() method in PHP tracker.