我想知道使用Google Analytics跟踪(网页浏览量,事件,自定义变量)的方式(如果可能) PHP调用 strong>(使用 问题是我们的客户想要跟踪一些无法使用JavaScript跟踪的特殊事件,或者我必须设置特殊(通常无用的) 我看到了一些PHP 项目应该提供这样的功能,但我想在纯PHP中使用它,因为我不允许将这样的第三方项目集成到我的中。 p>
所以我的问题:有没有办法在控制器中的PHP代码中跟踪Google Analytics而不是在JavaScript代码中跟踪 是什么? strong> p>
div> POST code> /
GET code>和
cURL code>或其他方法)而不是JavaScript。 p>
SESSION code>变量来检查是否设置 然后使用JavaScript进行跟踪并取消设置会导致模板中令人讨厌的代码...... p>
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?