Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 . 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

like image 374
nOmi Avatar asked Nov 04 '16 14:11

nOmi


People also ask

Can you see who clicks a link on Facebook?

No, Facebook does not share this information.

How do I find my link clicks on Facebook ads?

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).


1 Answers

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?)
  2. Is the referrer unique? (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.

It's already answered on Stack Overflow, how to get page view information for specific URLs in Google Analytics.

Here is how Google Shorten URL works (the examples are taken by 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. 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": { /* ... */ }
 }
}
like image 107
Jordan Enev Avatar answered Oct 11 '22 12:10

Jordan Enev