Link Link clicks posted on facebook

I am currently facing a problem that needs help. I am creating some URLs for my content on my website. Site users can post them in their groups, on Facebook pages. I want to count clicks on these posts. I tried using php function, but counting this function and fb data (people reached) are very different. (Fb view showing 3 times less than my amount of data) Why is this account different? and if I want fb people to reach the data, how can I get this, since the page on which the user will post messages is not mine.

Hi

+6
source share
1 answer

One possible approach is to implement your own referrer-based algorithm, but there are some cases that you should consider. At first glance, here are some of them.

I am sure that there are other pitfalls.

However, you can try some libraries of tracking URLs, such as Google Analytics (for advanced statistics) or Google Short URLs for basic ones.

He already answered Stack Overflow how to get pageview information for specific URLs in Google Analytics .

Here's how the Google Shorten URL works (examples taken by Google Shorten URLs ):

For your URL, you create an abbreviation:

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

If the generation was successful, you will receive the following answer:

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

Note that the id key is your shortened URL. This way you can save it in your database.

Later you can get URL reduction statistics as follows:

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

And here are the statistics:

 { "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": { /* ... */ } } } 
+5
source

Source: https://habr.com/ru/post/1012035/


All Articles