实施补充分析的最佳方式
我希望能够让我的作者看到他们的文章获得了多少流量。我可以在 Google Analytics 中执行此操作,但无法弄清楚如何在不让他们访问所有数据的情况下与他们共享这些数据,因此我正在考虑添加另一个分析服务,该服务将为每个作者的文章插入唯一的代码。我已经有了 GA 代码和 Quantcast 代码,所以我不想让我的网站陷入更多困境。我应该使用像素跟踪器还是 JavaScript 跟踪器?
更新:这是我在分析中用来跟踪我的作者的代码。
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
<?php if ( is_singular()) { ?>
pageTracker._trackEvent('Authors','viewed','<?php the_author_meta('ID'); ?>');
<?php } ?>
I want to be able to allow my writers to see how much traffic their articles are getting. I can do this in Google Analytics but can't figure out how to share this data with them without giving them access to all the data so I was thinking of adding another analytics service that would insert a unique code for each author on their articles. I already have the GA code and quantcast code so I don't want to bog down my site much more. Should I use a pixel tracker or javascript tracker?
UPDATE: Here is the code I use in analytics to track my authors.
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
<?php if ( is_singular()) { ?>
pageTracker._trackEvent('Authors','viewed','<?php the_author_meta('ID'); ?>');
<?php } ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用自定义字段通过作者可能拥有的唯一 ID 来跟踪作者。然后,您可以使用 GA 的 api 来提取自定义字段值 = 唯一 id 的数据,并将其显示在他们的个人资料中或您希望他们看到的任何位置。
you could use a custom field to track the writers by a unique id that they probably have. Then you could use GA's api to pull data where custom field value = unique id and display it in their profile or wherever you want them to see it.
一种选择是使用服务器本地 Redis 实例并使用 PHP Redis 库,使用作者 ID 和文章 ID 来增加本地计数器。
例如,如果在 Redis 中,您使用以 AuthorID 作为 Redis 键的排序集,并使用文章 ID(或者您标识文章的方式)作为使用 zincrby 对于每次加载,您都可以随时获取并控制数据。然后,您可以拥有一个 PHP 页面,从 Redis 中提取作者的数据并以您需要的任何格式显示它。例如,您可以构建一个表格来显示他们每篇文章的流量,或者制作漂亮的图表来显示它。您可以通过使用“AUTHORID:YYYY-MM-DD”的关键结构而不是仅使用作者 ID 来扩展上述内容以处理每日流量(例如)。
跟踪此问题的点击惩罚比访问外部站点要低得多 - 它应该在个位数毫秒的数量级。即使您的 Redis 实例位于其他地方,响应时间仍应低于外部跟踪。我知道您正在使用 GA,但这是您可以考虑的一种易于实现的方法。
One option would be to use a server-local Redis instance and use the PHP Redis library to increment a local counter using the author ID and article IDs.
For example, if in redis you use a sorted set with AuthorID as the redis key, and use the article ID (or however you identify an article) as a member that you increment using zincrby for each load you'll have the data readily available and under your control. You could then have a PHP page that pulls the author's data from Redis and display it in whatever format you need. For example you could build a table showing them traffic for each of their articles, or make pretty graphs to display it. You could extend the above to do per-day traffic (for example) by using a key structure of "AUTHORID:YYYY-MM-DD" instead of just author ID.
The hit penalty for tracking this is much lower than reaching out to an external site - it should be on the order of single-digit milliseconds. Even if your Redis instance was elsewhere the response times should still be lower than external tracking. I know you are using GA but this is a simple to implement method you could consider.
这稍微取决于您有多少位作者以及您的参与程度,我使用的主要类型是为
每个作者创建一个单独的视图并过滤他/她的流量
使用谷歌文档插件来提取作者数据并共享
使用 API 获取相关信息
如果您能更详细地指导您想要什么,我们很乐意提供更多细节
This slightly depends on how many authors you have and your level of involvement, main type I would use is either
Create a separate view per author and filter in his / hers traffic
Use a google docs plugin to pull down authors data and share
Use the API to pull down relevant information
Happy to give mor specifics if you could guide in more details what you want