Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the system supplies no nice user-agent, build one. #153

Merged
merged 1 commit into from
Feb 12, 2017

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Feb 11, 2017

I collected ~750k unknown devices, out of those 10% were unknown due to supplying no good user agent.
This PR adds user agent generation if none is available.
The agent is analog to most of the agents I've seen during collection and should hopefully work nicely with piwiks device-detector module.

The other 90% will require regex improvements.
A few popular ones are already covered in matomo-org/device-detector#5586
The rest will require lots of work 😦, see matomo-org/device-detector#5585

Closes #152.

@d4rken d4rken added this to the 2.0 milestone Feb 11, 2017
@d4rken d4rken requested a review from dotsbb February 11, 2017 09:27
String model = mBuildInfo.getModel();
String build = mBuildInfo.getBuildId();
httpAgent = String.format(Locale.US,
"Dalvik/%s (Linux; U; Android %s; %s Build/%s)",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl Thoughts on the format? Seems to be the most common Android http agent format.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess that should work fine

@d4rken d4rken merged commit 49e3b6d into matomo-org:2.0 Feb 12, 2017
@d4rken d4rken deleted the pr-httpagent branch February 12, 2017 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants