I would like to know the way (if possible) of Google Analytics tracking (pageviews, events, custom vars) using a PHP calls (using POST
/GET
with cURL
or other methods) instead of JavaScript.
The problem is our client want to track some special events that are unable to track using JavaScript or I would have to set special (and generally useless) SESSION
variables to check if set and then track using JavaScript and unset them that would lead into nasty code in templates...
I saw some PHP project that should provide such a functionality, but I would like to have it in pure PHP as I am not allowed to integrate such a third-party project into mine.
So my question: Is there a way of tracking Google Analytics from within a PHP code in controllers instead of JavaScript code in templates?