Skip to content

[Suggestion] Create built-in parser for user-agent info #43

Closed
designium opened this Issue Jun 7, 2012 · 2 comments

3 participants

@designium

Hi,

I'm currently using latest version of impressionist in my project to register views and I'm also using it to save user-agent data from users.

In one of my controller, I use the following method:

impressionist(@tracker, request.env['HTTP_USER_AGENT']) 

Impressionist saves the User Agent info into message variable.

Two example of the user agent info saved in the variables are:

  1. Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.163 Safari/535.19

  2. Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3

The issue with it is that it's hard to parse such information. There are thousand of user agent info and it would be great if there's a way to categorize them automatically by Impressionist.

This would make Impressionist much more powerful ruby gem and eventually, it would also parse the IP address by country.

@jgwmaxwell

I'll write the geocoding part and submit it to see what people think - certainly it would be some good extra information to include. As far as the UA Parser goes, that's a bit harder as there is a chunk that can be extracted - would people want platform, browser, browser version? just browser? It also increases the storage requirements again, and this gem already fills space quickly - that isn't an issue if self-hosting a database, but if you are using a SaaS one or on shared (eeek!) hosting then that might be a serious consideration.

@designium designium closed this Jul 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.