Page 1 of 1

Mobile version page detection not working with Gogglebot

Posted: Sun Nov 04, 2018 6:03 pm
by Bob200
Hi, I have this problem with a 1.5.26 Joomla Site :eek: :
I like the template, I'd prefere to fix the problem, instead to full upgrade the installation

User-agent detection php scripts
modify dynamically the rendering of the page ( full css or mobile version ),

they work correctly recognising a mobile visitor (rendering simplified css)
or a desktoy/tablet visitors (rendering a full css and larger page not responsive);
script are very old (2011) but recognise correctly mobile visitors, working fine

but they are failing in recognising specifically the goglebot for smartphone,

so when "goglebot for smarthone" is visiting the site,
it is recognises as an adroid tablet and get the full css large not responsive pages,
so the sites is marked as not mobile friends and with the recent "mobile firts"
google policy pages are been recently heavily penalised in ranking.

the scripts are old, they need some simply small modify to correct this issue,
If you replay to me please consider I'n not good at php reading/writing :geek: .

The template is based on an old Wasp 6 structure that you can see also here: ... rp/helpers

The scripts that do user-agent detection and modify the rendering of the pages
( calling mobile.js and mobile.css ) and need some modify are these: ... rowser.php ... ragent.php

The "goglebot for smartphone" have the same name ("googlebot") that
the "googlebot for desktop" ("goggebot") but can be recognised by his
different full declaration that is in this table:

The warp scripts are based on 2011, so it seams that googlebot for smartphone
(containg "android" in user-agent declaration) are recognised as a tablet visitors
instead of a mobile visitors, they need to add some new conditions to recognise
correctly the declaration of the 2018 "gogglebot for smartphone"


Re: Mobile version page detection not working with Gogglebot

Posted: Sun Nov 04, 2018 6:47 pm
by Per Yngve Berg
Joomla 1.5 does not have any mobil view support. You have to figure out this on your own.

Besides you will not be able to run the site when php 5.6 is going EOL and are removed from the server by your host. Do an upgrade.

Re: Mobile version page detection not working with Gogglebot

Posted: Wed Nov 07, 2018 2:51 am
by Bob200
Thanks Per Yngve Berg,
your advise about php 5.6 is usefull, I was not aware about this;
now I will verify how much time we have to do a un upgrade before
my host will finish 5.6. support to avoid to be in trouble.

About Mobile support, the theme we are using have some type of built-in
mobile support (not responsive pages, but dynamically modified CSS),
it is working fine with every mobile that visits the pages,
it is just googlebot-smartphone that is not recognised correctly.

I need a quik fix for this before planning a major upgrade
that we will have no time to do for a while.

I'm tryng to modify the php files I linked in the post,
It seams to me the fix it is very easy, like adding a line of code,
but problem is I'm not good at php; I'm asking also to some know
people here, hope to fix it.


Re: Mobile version page detection not working with Gogglebot

Posted: Thu Nov 08, 2018 3:27 am
by Bob200

With the help of a friend that know php, we add a few lines of code
and now in the file useragent.php there is an additional filter to
be sure gogglobot for smartphone is recognised ad a mobile devise
and so server generates dinamically pages with the mobile css.

we added in useragent.php :

- at line 176 we added the name for an additiona filter,
and we put it in the list of the filters in the second position,
added this line:

- at line 272 ( just after the block of the first filter, the filterGoogleAndroid )
added the more simple possible condition of the filter:

* Googlebot smartphone 2018 - recognition as a mobile devise - by Carlo

public function filterGoogleBotSmartphone2018(&$userAgent) {
if (strpos($userAgent['string'], 'nexus')) {
$userAgent['operating_system'] = 'android';

There are many other ways to to the same trick,
for example instead to search for the word ' Nexus /nexus '
one can search in teh useragent decalartion for the word
'mobile' and some more conditions to separate tablet
from smartphone, or modify also the file browser.php,
but for the moment this additional filter fixed the problem.

I wroted more detail on how browser.php and useragent.php
works on this joomla installations in the italian joomal forum
(you can read using a translator the complete explication):


Re: Mobile version page detection not working with Gogglebot

Posted: Fri May 03, 2019 5:24 pm
by pritom38000
right now I am facing the same problem.