Detect Internet Explorer 11

I use piwik 2.0.2 and only changed the browser.yml file like it is done in the forthcoming 2.0.3 – but nothing happens, IE 11 is still displayes as unknown. Is there anything to do else besides changing browser.yml ?

Same problem here.

Posted earlier about this a few days ago: 301 Moved Permanently

Any help would be appreciated.

SR

if you change the brwser line for ie 11 to

Trident/7.0;*rv:11.0

or

Trident/7.0*rv:11.0

does that help?

No, we both made the changes suggested in the link I provided.

Matt suggested the latest beta, where can I get that?

Thanks,

SR

What is the user agent that is not properly detected?

Hi Matt,

My issue is slightly different in that my Piwik installation does not detect any visits. I’ve updated my thread

Thanks,

SR

@Matt:

“Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko” is an example of an user agent I found in my apache log where in piwik the visit is counted, but with browser unknown.

I added it to the tests: https://github.com/piwik/piwik/blob/master/tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml

it now works in git

I was too focused on the nice syntax of browser.yml - and have not realized that it is only used when the plugin DevicesDetection is activated. It isn’t activated in my configuration, cause it’s marked as beta.

So now I found the right place for changes if you do not use the DevicesDetection plugin:

libs/UserAgentParser/UserAgentParser.php

After line 128 I added
’trident’ => ‘IE’,

and changed (former) line 518 from
&& strncmp($userAgent, ‘Mozilla/4.0’, 11) == 0
to
&& (strncmp($userAgent, ‘Mozilla/4.0’, 11) == 0 || strncmp($userAgent, ‘Mozilla/5.0’, 11) == 0)

Now it works and I would suggest to change UserAgentParser.php as mentioned in piwik 2.0.3

Thanks I fixed it. IE11 detection fix when not using DevicesDetection · matomo-org/matomo@be3673c · GitHub
soon we will remove this old code and only use DevicesDetection hopefully!

Please note that my mentioned new line after line 128 is needed:
‘trident’ => ‘IE’,

Without that, no browser id would be set (which will be $info[‘id’] in line 518!) and the lines 516-524 are not triggered. So please add this change, too.

And please add it NOT as line 131 (which I did first). Then the IE would be called Trident in piwik.

Thanks for review, this was fixed!

I can’t see any fix in matomo/UserAgentParser.php at be3673cf1a7344e3d82cdf1655ed193f3675689e · matomo-org/matomo · GitHub

Please just:
+128 ‘trident’ => ‘IE’,

Without this it would not work!

@Oliver lost:
Thank you for this fix.

I implemented this into “libs/UserAgentParser/UserAgentParser.php” in version 1.12 (I haven’t upgraded yet), and it works perfectly.

Ah, I see now :slight_smile:

For me it works great, too. No more “unknown” browsers. And more IE 11-user then any other IE-version.