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 . 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? and if i want fb people reach data how can i get that as the page where user will post is not mine.
Regards
No, Facebook does not share this information.
To see your link click results broken down by specific destinations, go to Ads Manager and click Breakdown→ By action→ Link click destination. The metric Clicks (All) includes link clicks as well as clicks on other parts of your ad (e.g. someone clicks on your Page's name).
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.
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.
It's already answered on Stack Overflow, how to get page view information for specific URLs in Google Analytics.
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. So you can store it in your Database.
Later you can get your shorten URL statistics by the following call:
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": { /* ... */ }
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With