如何使用 Google Analytics 或 Yahoo Web Analytics 跟踪对 Facebook 页面的访问?

发布于 2024-10-05 18:15:31 字数 164 浏览 8 评论 0原文

我最近对此进行了研究,发现在 Facebook 粉丝页面中使用 FBML 页面,我可以添加 fb:google-analytics 标签或图像标签来跟踪页面访问。然而,我没有找到任何方法来跟踪对其他 Facebook 标签页的访问,例如“图片”或“墙”。

有办法做到这一点吗?

谢谢

I have recently looked into this and discovered that using FBML pages in a facebook fan page, I can add fb:google-analytics tags or image tags to track page visits. However I have found no method of tracking visits to other facebook tab pages, like "pictures" or "wall".

Is there a way do this?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黑凤梨 2024-10-12 18:15:31

Google Analytics 无法做到这一点。

曾经有一个 嵌入了 php 的 hack文件作为图像,并且该请求跟踪页面浏览量。然而,Facebook 呈现页面方式的改变使得这个黑客/插件变得毫无用处(看起来它在 9 月 7 日停止工作)。基本上,看起来他们正在将任何外部图像缓存到自己的服务器上,从而破坏了这个黑客行为。如果没有官方支持的插件,或者 Facebook 允许谷歌跟踪更多内容,这可能是一个死胡同。

编辑:使用 Facebook 标签,您可以将 iframe 应用安装为标签(不使用 FBML),并且可以将 Google Analytics 放在该标签上。但是,由于它是一个 iframe,因此您无法访问真实的引荐来源网址信息,并且 Facebook 会欺骗其引荐来源网址,因此 iframe 无法检测有关页面的任何信息。但这仅适用于选项卡,不适用于墙壁或照片。

另一件需要注意的重要事情是,cookie 仍在您的域中设置,因此将帐户保留在您的主帐户上可能是有意义的,但在选项卡上使用特殊配置。

以下是我确定的将 Google Analytics(分析)置于 Facebook 选项卡 iframe 上的最佳实践:

首先,iframe URL 应包含 URL 参数 ?utm_nooverride=1。如果用户已经有推荐 cookie(例如,如果他们之前通过 Google 访问过您的网站,则综合浏览量将与该推荐源保持一致。)

其次,我覆盖推荐人值(这是无用的,因为它是欺骗性的)由 Facebook)更改为 tab.facebook.com,以便轻松区分其他流量。

最后,我放置了 2 个自定义变量:一个页面级别的变量和一个访问者级别的变量。前者使我可以轻松了解选项卡内发生的综合浏览量。第二个允许我跟踪我的网站与此人的其余交互(如果他们最终返回我的网站)。该代码如下所示:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-1']);
_gaq.push(['_setReferrerOverride', 'http://www.tab.facebook.com']);
_gaq.push(['_setCustomVar', 1, 'is_facebook_page', 'true', 3]);
_gaq.push(['_setCustomVar', 2, 'visited_facebook', 'true', 1]);
_gaq.push(['_trackPageview']);

There is no way of doing this with Google Analytics.

There used to be a hack that embedded a php file as an image, and that request tracked a pageview. However, a change to how Facebook renders pages makes this hack/plugin useless (it looks like it stopped working on September 7th). Basically, it looks like they're caching any external images onto their own servers, and thus breaking this hack. Short of there being an officially supported plugin, or Facebook allowing Google to track more, this is likely a dead end.

Edit: With Facebook tabs, you can install an iframe app as a tab (not using FBML), and you can put Google Analytics on the tab. But, since its an iframe, you don't have access to real referrer information, and Facebook spoofs its referrer, so there's no way for the iframe to detect anything about the page. But this is only for the tab, not for the wall or photos.

Another important thing to note is that the cookies are still being set on your domain, so it might make sense to keep the account on your main account, but use a special configuration on the tab.

Here's the best practice I've settled on for putting Google Analytics on a Facebook tab iframe:

First, the iframe URL should contain the URL parameter ?utm_nooverride=1. This is so if the user already has referral cookies (for example, if they got to your site before via Google, the pageview will persist with that referral source.)

Second, I override the referrer value (which is useless, since it is spoofed by Facebook) to be tab.facebook.com, to make it simple to differentiate from other traffic.

Finally, I place 2 custom variables: One page-level, and one visitor level. The former allows me to easily know what pageviews occurred from within the tab. The second allows me to track the rest of the interactions my site has with this person if they end up returning to my site. That code looks like this:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-1']);
_gaq.push(['_setReferrerOverride', 'http://www.tab.facebook.com']);
_gaq.push(['_setCustomVar', 1, 'is_facebook_page', 'true', 3]);
_gaq.push(['_setCustomVar', 2, 'visited_facebook', 'true', 1]);
_gaq.push(['_trackPageview']);
墟烟 2024-10-12 18:15:31

Facebook 确实提供了一些称为 Facebook Insights 的有限分析功能:

此外,传出链接将标有跟踪代码,以便您可以了解哪些流量是从您的 Facebook 页面流向您的网站。

但是,您无法将 Google Analytics 或 Yahoo Analytics 直接嵌入到页面中。

Facebook does provide some limited analytics capabilities called Facebook Insights:

Also outgoing links will be tagged with a tracking code so you can pick up which traffic is coming from your Facebook pages to your site.

However you cannot embed Google Analytics or Yahoo Analytics directly into the pages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文