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

Get OS and Version #77

Open
SimonVillage opened this issue May 3, 2017 · 4 comments
Open

Get OS and Version #77

SimonVillage opened this issue May 3, 2017 · 4 comments

Comments

@SimonVillage
Copy link

SimonVillage commented May 3, 2017

Is there a solution to get the OS and Version tracked in UA?
Would this be an option?

visitor.set('ua', process.platform +' '+ require('os').release());

@jtillmann
Copy link
Member

Of course it is, but I assume you want the visitor's user agent?

In Express you could use something like this:

visitor.set('ua', req.headers['user-agent']);

@SimonVillage
Copy link
Author

We are developing an electron app so the user-agent should be always the same or am I wrong?

@jtillmann
Copy link
Member

I wasn't aware you're talking about an Electron app. I'm not sure if the UA should always be the same.

I'm not sure if process.platform +' '+ require('os').release() will result in a User Agent string that GA will process.

You should know best how to access Electron's User Agent from within the app. You can directly pass that to the ua parameter.

@freiSMS
Copy link

freiSMS commented May 9, 2019

Hello, I am facing a similar problem. I want to set the userAgent in a way that GA will extract OS and Browser from it. @SimonHausdorf when I try to use your version all ua traffic is mapped to the browser field. Did you get this working? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants