简体   繁体   English

在Facebook上发布的Track Link点击次数

[英]Track Link clicks posted on facebook

I am currently facing an issue need help . 我目前正面临一个需要帮助的问题。 I am creating some URLs to my content on my website . 我正在网站上为我的内容创建一些网址。 Users of site can post them on their groups, pages on Facebook . 网站用户可以将其发布在Facebook上的群组页面上。 I want to count clicks on those posts . 我想计算这些帖子的点击次数。 I tried with a php function but the count from that function and fb insights (people reached) is very different.(fb insight showing 3 times less thn my data count) Why is that count is different? 我尝试使用php函数,但该函数的计数和fb见解(达到的人数)是非常不同的。(fb洞察力显示我的数据量减少3倍)为什么这个数量不同? and if i want fb people reach data how can i get that as the page where user will post is not mine. 如果我想要fb人们获取数据我怎么能得到它作为用户将发布的页面不是我的。

Regards 问候

One possible approach is implementing your own algorithm based on the referrer, but there are some cases these you have to take in account. 一种可能的方法是基于引用者实现您自己的算法,但在某些情况下您必须考虑这些。 On a first thought here are some of them. 首先想到的是其中的一些。

  1. How to determine unique clicks? 如何确定唯一点击? (IP, Browser data or combination of both?) (IP,浏览器数据或两者的组合?)
  2. Is the referrer unique? 推荐人是独一无二的吗? ( https://www.facebook.com/ , https://m.facebook.com/ ) https://www.facebook.com/https://m.facebook.com/

I'm sure that there are other pitfalls too. 我确信还有其他陷阱。

However you can try some tracking URL library, for example Google Analytics (for advanced statistics) or Google Short URL for a basic ones. 但是,您可以尝试使用某些跟踪网址库,例如Google Analytics (用于高级统计信息)或Google Short URL用于基本网址库。

It's already answered on Stack Overflow, how to get page view information for specific URLs in Google Analytics . 它已在Stack Overflow 上得到解答, 如何获取Google Analytics中特定网址的网页浏览信息

Here is how Google Shorten URL works (the examples are taken by Google Shorten URL Docs ): 以下是Google Shorten URL的工作原理(示例由Google Shorten URL Docs提供 ):

For your URL you generate a shorten one: 对于您的网址,您会生成一个缩短的网址:

curl https://www.googleapis.com/urlshortener/v1/url \
  -H 'Content-Type: application/json' \
  -d '{"longUrl": "http://www.google.com/"}'

If generation is successful, you will receive the following response: 如果生成成功,您将收到以下响应:

{
 "kind": "urlshortener#url",
 "id": "http://shortenurl/",
 "longUrl": "http://www.google.com/"
}

Please note that id key is your shorten URL. 请注意, ID密钥是缩短的网址。 So you can store it in your Database. 所以你可以将它存储在你的数据库中。

Later you can get your shorten URL statistics by the following call: 稍后您可以通过以下调用获取缩短的URL统计信息:

curl 'https://www.googleapis.com/urlshortener/v1/url?shortUrl=http://shortenurl/fbsS&projection=FULL'

And here are the stats: 以下是统计数据:

{
 "kind": "urlshortener#url",
 "id": "http://shortenurl/",
 "longUrl": "http://www.google.com/",
 "status": "OK",
 "created": "2009-12-13T07:22:55.000+00:00",
 "analytics": {
  "allTime": {
   "shortUrlClicks": "3227",
   "longUrlClicks": "9358",
   "referrers": [ { "count": "2160", "id": "Unknown/empty" } /* , ... */ ],
   "countries": [ { "count": "1022", "id": "US" } /* , ... */ ],
   "browsers": [ { "count": "1025", "id": "Firefox" } /* , ... */ ],
   "platforms": [ { "count": "2278", "id": "Windows" } /* , ... */ ]
  },
  "month": { /* ... */ },
  "week": { /* ... */ },
  "day": { /* ... */ },
  "twoHours": { /* ... */ }
 }
}

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

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