Mobile version page detection not working with Gogglebot Topic is solved

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

Post Reply
Bob200
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 04, 2018 5:15 pm

Mobile version page detection not working with Gogglebot

Post by Bob200 » Sun Nov 04, 2018 6:03 pm

Hi, I have this problem with a 1.5.26 Joomla Site :eek: : www.centro-hikikomori.it
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:
https://github.com/arleincho/cis/tree/m ... 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:

https://github.com/arleincho/cis/blob/m ... rowser.php

https://github.com/arleincho/cis/blob/m ... 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:

https://support.google.com/webmasters/answer/1061943

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"

Thank
Bob

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 24886
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Mobile version page detection not working with Gogglebot

Post by Per Yngve Berg » Sun Nov 04, 2018 6:47 pm

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.

Bob200
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 04, 2018 5:15 pm

Re: Mobile version page detection not working with Gogglebot

Post by Bob200 » Wed Nov 07, 2018 2:51 am

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.

Bob

Bob200
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 04, 2018 5:15 pm

Re: Mobile version page detection not working with Gogglebot

Post by Bob200 » Thu Nov 08, 2018 3:27 am

SOLVED

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:
'filterGoogleBotSmartphone2018',

- 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):
http://forum.joomla.it/index.php?topic=269624.new#new

Best
Bob


Post Reply

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”