MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - test agents detected as mobile browsers by some cms

WebPagetest Forums

Full Version: test agents detected as mobile browsers by some cms
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im trying to test a site which runs on Kentico CMS...

On testing on major browsers locally, it shows the website fine, but on webpagetest.org it redirects to the mobile version.

After initial debugging, i figured it is based on the user agent.

for example user agent of "Gloucester, UK - IE7 - DSL" is :-
Code:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; PTST 2.252)

When i make a request to the site with this useragent from any browser it will be redirected to the mobile site, but if i delete the ; PTST 2.252 portion, it returns the normal website just fine.

On googling i couldnt find any documentation about the PTST portion.

Even on my decent trafficked website, only 4 out of 1071901 hits contained the term PTST .

Is this some user agent string unique to webpagetest?

Is there a way to mention a custom user-agent string while making a test?

FYI :-

Code:
sajal@sajal-laptop:~$ HEAD -S -H 'User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; PTST 2.252)' http://www.<snip>.com/home.aspx
HEAD http://www.<snip>.com/home.aspx --> 302 Found
HEAD http://www.<snip>.com/mobile/home.aspx --> 200 OK
[...]

sajal@sajal-laptop:~$ HEAD -S -H 'User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)' http://www.<snip>.com/home.aspx
HEAD http://www.<snip>.com/home.aspx --> 200 OK
[...]

Note: Second request has the PTST portion removed
PTST is a pagetest-specific user agent string that gets injected when testing so it's easy to find (and filter) your test traffic. Unless they were explicitly trying to test a mobile site with WebPagetest I can't imagine why you're seeing what you are (being that picky about user agent strings would send most of their users to mobile).

You can override the user agent string with a script: http://www.webperformancecentral.com/wik...tUserAgent

Something like:

Code:
setUserAgent    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
navigate    http://www.<snip>.com/home.aspx

(make sure there are tabs between the commands and values when you paste it into the script field).
Thanks a lot. works like a charm.

My earlier attempts to play with scripted tests were a FAIL(probably cause of the tabs) ... now scripted tests will keep me busy for days Smile

Ive already passed a message to the person concerned about the aggressive/faulty mobile detection... but its not in my hands.... ".aspx" in the url is usually a good indicator of the quality of CMS they use ....
lol

btw, I tweaked the site a few days ago so you can actually add tabs directly in the script edit field (and breaking usability and the ability to actually tab out of the box but seemed like it was worth it) so it should be easier to deal with scripts now.
Reference URL's