nOm*_*Omi 6 php facebook facebook-insights
我目前正面临一个需要帮助的问题.我正在网站上为我的内容创建一些网址.网站用户可以将其发布在Facebook上的群组页面上.我想计算这些帖子的点击次数.我尝试使用php函数,但该函数的计数和fb见解(达到的人数)是非常不同的.(fb洞察力显示我的数据量减少3倍)为什么这个数量不同?如果我想要fb人们获取数据我怎么能得到它作为用户将发布的页面不是我的.
问候
一种可能的方法是基于引用者实现您自己的算法,但在某些情况下您必须考虑这些.首先想到的是其中的一些.
我确信还有其他陷阱.
但是,您可以尝试使用某些跟踪网址库,例如Google Analytics(用于高级统计信息)或Google Short URL用于基本网址库.
它已在Stack Overflow 上得到解答,如何获取Google Analytics中特定网址的网页浏览信息.
对于您的网址,您会生成一个缩短的网址:
curl https://www.googleapis.com/urlshortener/v1/url \
-H 'Content-Type: application/json' \
-d '{"longUrl": "http://www.google.com/"}'
Run Code Online (Sandbox Code Playgroud)
如果生成成功,您将收到以下响应:
{
"kind": "urlshortener#url",
"id": "http://shortenurl/",
"longUrl": "http://www.google.com/"
}
Run Code Online (Sandbox Code Playgroud)
请注意,ID密钥是缩短的网址.所以你可以将它存储在你的数据库中.
稍后您可以通过以下调用获取缩短的URL统计信息:
curl 'https://www.googleapis.com/urlshortener/v1/url?shortUrl=http://shortenurl/fbsS&projection=FULL'
Run Code Online (Sandbox Code Playgroud)
以下是统计数据:
{
"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": { /* ... */ }
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
579 次 |
| 最近记录: |