Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify if a page request is for a preview

Tags:

http

web

When I paste my website link at a social network (Facebook or Twitter for example), the social network access my site to show a preview to the user.

I want to separate this access from real access at my reports, but to do this, I need to identify this cases.

This kind of access send any kind of information that is default for everysite that I can identify that this access is not a real user, but a robot?

like image 495
Bruno Croys Felthes Avatar asked May 25 '18 14:05

Bruno Croys Felthes


1 Answers

You should be able to identify those robots from their user-agent string. For example, Twitter uses the User-Agent of Twitterbot. And Facebook crawler identification is documented here.

like image 77
junkangli Avatar answered Oct 14 '22 14:10

junkangli