Detect Googlebot, Android, iPhone/iPad using javascript [client-side] (newbies)

b4br 514h

Newbie
Joined
Dec 19, 2011
Messages
34
Reaction score
10
Here's a little script to help newbies with detecting what type of visitor they are having.

Detect Googlebot:
Code:
var isGoogle = navigator.userAgent.toLowerCase().indexOf('googlebot') > 0;

Detect Android:
Code:
var isAndroid = navigator.userAgent.toLowerCase().indexOf('android') > 0;

Detect iPhone and iPad:
Code:
var isApple = navigator.userAgent.toLowerCase().indexOf('iphone') > 0 ||  navigator.userAgent.toLowerCase().indexOf('ipad') > 0;

For best cloacking you should Always also check server-side, for example IP address.
 
Last edited:
Javascript cloacking is so easy to detect thats make it completly useless.
 
Javascript cloacking is so easy to detect thats make it completly useless.
Any type of cloaking is easy to detect, some easier than others, but sooner or later they'll find out anyway.
If your were a BHatter you would know this by now.

As I said in the OP, you should also clock server-side.
 
And like you were kind enough to point out, there are a lot of newbies around. And those of US who are new, at least in the first year or so, we tend to have dumb questions and then make some dumb mistakes.

I'm a point now after months of trying to learn and trying to spend some money but losing it... to do the opposite of what I did in 2005 and I was around the 6 month time of a long relationship: I quit back then, but this time I simply refuse to do so. I have a small business IRL, and I'm waiting on a certain commission to come in, then I'm going to apply myself to creating a plan and following through... if it doesn;t work, then i'll find out what got in its way...
...and I'll never do THAT again. :)

OP EDIT: Oh, my point was to say "thank you." I'm doing everything on client-side, and I just don't know what i need to learn or who to ask to get me really learning and really fixing my efforts. My family depends on it. I depend on it.
So thank you for the varied bots. You're very talented. ;-)
 
Last edited:
Mars your welcome bro. There are some tips I want to give you:

1: Don't Ever give up! There is a nice thread here called "BlackHat Sucess: Never give up!" read that and also a comment about Edison saying "I never failed, it's just that making the light bulb was a 99-step process." Keep that in mind!
2: No one here was born knowing SEO and IM. They all had to learn it some how, and believe me it's not easy.
3: A dumb question does not exist, you have to keep asking and if they don't like it they can go f them self.
4: Study before spending money. Don't spend a single dime until your 99% sure it's going to work. You can always ask the wonderful gurus here for tips before you get started.

I am also like you a newbie to this IM world, but if there is anything you think I can help you with, please PM, if not too complicated I'll be happy to help you out for free.

Good luck,
B4br 514h
 
Back
Top