#3642 closed Bug (fixed)

User agent information can be identified when use the log analysis

Reported by: mihui Owned by:
Priority: major Milestone: 1.12.x - Piwik 1.12.x
Component: Core Keywords:
Cc: Sensitive: no

Description

Here is the sample of the "user agent" from the iis log:

Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2)

It turns out the browser is "Unknown" and also for the OS.

Change History (7)

comment:1 Changed 16 months ago by mihui

User agent information can NOT be identified when use the log analysis

Here is the sample of the "user agent" from the iis log:

Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2)

It turns out the browser is "Unknown" and also for the OS.

comment:3 Changed 16 months ago by mihui

It is working in the test file of "UserAgentParser", but not in the real case because in the "/core/Tracker/Visit.php", it is not using "urldecode" function for the user agent information, but test file.

Please check and re-open if I'm right. :)

comment:4 in reply to: ↑ 2 Changed 16 months ago by mihui

Replying to matt:

detected as ie8 on win7

you can test yourself at: http://demo.piwik.org/libs/UserAgentParser/UserAgentParser.test.php?setUserAgent=Mozilla/4.0+%28compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2%29

It is working in the test file of "UserAgentParser", but not in the real case.
Because in the "/core/Tracker/Visit.php", it is not using "urldecode" function for parsing the user agent information.

My solutions were:

1) I tried to use "urllib.unquote_plus" in python script to parse the "user agent" before sending requests to the Piwik
2) Also tried "urldecode" function in the "Visit.php"

But the visit report had different statistics, so I'm using "2" for now.

Please check and re-open if I'm right. :)

comment:5 in reply to: ↑ 2 Changed 16 months ago by mihui

Replying to matt:

detected as ie8 on win7

you can test yourself at: http://demo.piwik.org/libs/UserAgentParser/UserAgentParser.test.php?setUserAgent=Mozilla/4.0+%28compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2%29

btw, below "$userAgent = $this->getUserAgent($this->request);",

I added:

$userAgent 		= urldecode($userAgent);

in the "/core/Tracker/Visit.php"

comment:6 Changed 15 months ago by matt (mattab)

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:7 Changed 15 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [7777]) Fixes #3642 Thanks for the report

Note: See TracTickets for help on using tickets.