简体   繁体   English

如何将 Google Analytics 添加到 Github 存储库

[英]How to add Google Analytics to Github respository

I like to add google analytics on my github respository.我喜欢在我的 github 存储库中添加 google 分析。 So i can keep track of user visit.所以我可以跟踪用户访问。

Unfortunately, you cannot use Google Analytics to monitor your GitHub repository page because you simply do not own the page.不幸的是,您不能使用 Google Analytics 来监控您的 GitHub 存储库页面,因为您根本不拥有该页面。 GitHub offers their own traffic analytics platform . GitHub 提供了自己的流量分析平台

I have not verified this myself, but you if you have a GitHub Pages site at <your GitHub username>.github.io (or a specific project page using GitHub Pages), you could add Google Analytics to that site.我自己没有验证过,但是如果您在<your GitHub username>.github.io (或使用 GitHub Pages 的特定项目页面)有一个 GitHub Pages 站点,则可以将 Google Analytics 添加到该站点。 It won't necessarily capture visits to the specific repository page, but it could help, especially if you have a particularly active GitHub Pages website.它不一定会捕获对特定存储库页面的访问,但它可能会有所帮助,特别是如果您有一个特别活跃的 GitHub Pages 网站。

See this related post for more info: How to add Google Analytics Tracking ID to GitHub Pages有关更多信息,请参阅此相关帖子: 如何将 Google Analytics 跟踪 ID 添加到 GitHub 页面

With ga-beacon you should be able to do minimal Google Analytics tracking on your GH repo.使用ga-beacon,您应该能够对您的 GH 存储库进行最少的 Google Analytics 跟踪。 You won't be able to track to the level of detail that GH's own analytics does, but you should at least be able to track visits to your main repo page, for instance.例如,您将无法跟踪到 GH 自己的分析所做的详细程度,但您至少应该能够跟踪对主要 repo 页面的访问。

I made a web app to record repo traffic, stars and other analytics data of github repos.我制作了一个web 应用程序来记录 github repos 的 repo 流量、stars 和其他分析数据。

在此处输入图片说明

The Segment tracking pixel works great for this. Segment 跟踪像素非常适合于此。 Just embed that in your README/other files and you can record anonymous page hits to your repo.只需将其嵌入您的自述文件/其他文件中,您就可以将匿名页面点击记录到您的存储库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM