is there any way to detect bots (like google) with JS?

1.7k views Asked by At

i want to create additional page visit analytics (for a/b test) with js. but i need to exclude google bots.

is there any way to exlude bots like google bot in js without any captcha or form validation ?

1

There are 1 answers

0
ippi On

How about the noindex-meta-tag?

In javascript you can check the navigator.userAgent if it matches with any of those.

Edit: I realize this might not be the answer you were looking for. Is that google analytics? How about goint to Admin > View > View Settings > Bot Filtering "Exclude all hits from known bots and spiders".