简体   繁体   中英

How to ge the search engine name from a web page using javascript?

How to identify the search engine using javascript? Say for example if the site has been displayed using the google search, I should get the value as google, similarly yahoo,bing etc.. Is there any written js code for doing so?

In general you can use Google analytics .

In JavaScript , you can use document.referrer :

Returns the URI of the page that linked to this page.

...

The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark). Since this property returns only a string, it does not give you DOM access to the referring page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM