如何从Python触发Google Analytics(分析)事件? [英] How to trigger Google Analytics events from Python?
问题描述
我正在开发一个拥有REST API的网站,并且我想使用Google Analytics(分析)事件跟踪API使用情况。有没有一个直接的方法来触发Python的GA事件,不需要加载整个 webbrowser
组件来发送一个javascript请求?
I'm developing a site that has a REST API and I'd like to track the API usage using Google Analytics events. Is there a straightforward way to trigger GA events from Python that doesn't involve loading up an entire webbrowser
component just to send a javascript request?
推荐答案
在python中有一个Google Analytics(分析)for Mobile的开源实现: http://github.com/b1tr0t/Google-Analytics-for-Mobile--python-
There is an open source implementation of Google-Analytics for Mobile in python available here: http://github.com/b1tr0t/Google-Analytics-for-Mobile--python-
您可以通过导入
'track_page_view'并将其
与适当的WSGI请求$ b整合到
中
环境。
You can probably integrate this into your own setup by importing 'track_page_view' and providing it with the appropriate WSGI request environment.
这篇关于如何从Python触发Google Analytics(分析)事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!