开发者

google analytics under pypi doc page (packages.python.org)

I'm trying to add a google analytics tracker to the documentation pages of my python project (hosted under http://pa开发者_如何学Pythonckages.python.org/myProject). Doc pages are generated using sphinx.

I have tried Single Domain and MultiDomain options for the tracker, but Google Analytics seem not to detect the script (which, I have tested, is correctly inserted in all the pages including index.html).

Is there any known limitation that prevents me from using Analytics, Sphinx and PyPI documentation hosting?

thanks!


You probably need to use the _setCookiePath option.

In particular, if your app is at http://packages.python.org/myProject/:

  • add _gaq.push(['_setCookiePath', '/myProject/']); into your snippet, right before _gaq.push(['_trackPageViews']);.

  • Also, under the "new" (as of 10/2011) analytics interface, I think you have to change the web property's default url to read http://packages.python.org/myProject/, not just the domain name.

  • Note the trailing / after myProject in the above steps.

There does currently seem to be a bug with the new interface, it showed the tracker as "not enabled" for me, but when I did all the above and switched back to the "old" interface, it showed the tracker as active, and I seem to be getting data when people check my library's python manual.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜