device-detector icon indicating copy to clipboard operation
device-detector copied to clipboard

Bot not detected - WhatsApp

Open jLynx opened this issue 8 years ago • 14 comments

The bot that is not being detected is:

WhatsApp/2.12.15/i

jLynx avatar Mar 12 '16 23:03 jLynx

Not sure if that should be detected as bot. Whatsapp is an mobile app and it should already be detected as those. I guess the useragent is used when getting page content for previewing links within a chat. So I guess it's more or less triggered by the user and no "automatic" bot

sgiehl avatar Mar 14 '16 11:03 sgiehl

As much as it is triggered by the user, it is still a bit as when a user clicks a link, it has the whatsapp bot still visit the Page and then the user visits it, I guess it just collects meta data for its database. But I would still call it a bot since the initial view it's getting isn't the real user

jLynx avatar Mar 14 '16 18:03 jLynx

Would be nice to add this "bot"

thE-iNviNciblE avatar Jan 12 '17 21:01 thE-iNviNciblE

Indeed it is a bot.

When you type (or paste) a URL within a WhatsApp conversation, the WhatsApp server loads the URL and parses the Open Graph meta tags. More specifically, it loads the og:image meta tag, which usually loads a relevant image of the URL.

It is common to see two hits, like this:

"GET / HTTP/1.1" 206 11133 "-" "WhatsApp/2.16.16/i"
"GET /images/logo.png HTTP/1.1" 206 18093 "-" "WhatsApp/2.16.16/i"

The first loads the URL as it was typed or pasted in the WhatsApp conversation, the second loads the relevant og:image meta tag, in this case a logo.

ghost avatar Mar 29 '17 09:03 ghost

Is there any fix to it yet?

whimsicaldreamer avatar Apr 19 '17 18:04 whimsicaldreamer

Any update to this issue?

jLynx avatar Aug 13 '18 21:08 jLynx

👍 Any updates? It's a snippet request and it's straightforward to treat it as a ‘bot’

Ethreal avatar Sep 13 '19 14:09 Ethreal

I have now tested this myself and indeed during writing of a URL, whatsapp fetches the page to show the preview. (even before sending the message).

But the IP address isn't the one of the Whatsapp servers, but the one of the phone, so the app itself fetches the meta tags.

198.51.100.0 - - [13/Sep/2019:17:24:29 +0200] "GET / HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:32 +0200] "GET / HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:32 +0200] "GET /te HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:33 +0200] "GET /ted HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:33 +0200] "GET /tedt HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:34 +0200] "GET /tes HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:35 +0200] "GET /test HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:53 +0200] "GET /t HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:53 +0200] "GET /hg HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:53 +0200] "GET /hgf HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgfff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgffff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgfffff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgffffff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:54 +0200] "GET /hgfffffff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:24:55 +0200] "GET /hgffffffff HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"
198.51.100.0 - - [13/Sep/2019:17:25:05 +0200] "GET / HTTP/1.1" 200 1036 "-" "WhatsApp/2.19.229 A"

Findus23 avatar Sep 13 '19 15:09 Findus23

it seems not to be added, why?

you could count this as social media traffic....

thE-iNviNciblE avatar Feb 09 '20 18:02 thE-iNviNciblE

it should be detected as mobile app. See https://github.com/matomo-org/device-detector/blob/master/regexes/client/mobile_apps.yml#L82-L85

sgiehl avatar Feb 09 '20 20:02 sgiehl

if i test this with web.whatsapp.com and add a link from the shop, i cant see this request. maybe the snippet generator doesn't open the page with javascript and can't be tracked.

Maybe the WhatsApp "Bot" is using grabing the source of html/text. I can see the call in my access.log from the webserver.

thE-iNviNciblE avatar Feb 21 '20 09:02 thE-iNviNciblE

This issue should be closed.

liviuconcioiu avatar Jan 22 '21 11:01 liviuconcioiu

Just to make this issue clear, @liviuconcioiu, why do you think this should be closed?

One could argue if the app on the phone should count as a bot, but as it is making automated requests the user doesn't initialize, I think excluding it and detecting it as a bot instead of an app wouldn't be unreasonable.

Findus23 avatar Jan 22 '21 12:01 Findus23

if we consider useragent ^WhatsApp/\d+([\d+\.]+) A$ to be a bot, we may break the page preview functionality in the WhatsApp app. Since some pages do not show the content to the bot.

Similar functionality is available in applications SkypePreview, Telegram.

If Skype SkypePreview is a bot, then this user agent should also be considered a bot, based on the precedent

- 
  user_agent: Mozilla/5.0 (Windows NT 6.1; WOW64) SkypeUriPreview Preview/0.5
  bot:
    name: Skype URI Preview
    category: Service Agent
    url: ""
    producer:
      name: Skype Communications S.à.r.l.
      url: https://www.skype.com

sanchezzzhak avatar Jan 22 '21 12:01 sanchezzzhak