Giter Club home page Giter Club logo

Comments (5)

tommedema avatar tommedema commented on August 20, 2024

For some reason your built files are incorrect. When I go to node_modules/@amplitude/dist/src/nodeClient.js I see:

Screen Shot 2021-02-10 at 3 07 09 PM

Yet this code has been patched:

event.platform = event.platform ?? 'Node.js';

Yet the version I have installed is the latest version:

Screen Shot 2021-02-10 at 3 07 18 PM

from amplitude-node.

kelvin-lu avatar kelvin-lu commented on August 20, 2024

Hey @tommedema !

We haven't published those changes - apologies. I'll go ahead and publish the newest version and close this once Node 1.3.3 is available!

from amplitude-node.

tommedema avatar tommedema commented on August 20, 2024

Ok, thanks @kelvin-lu -- and now that I have you, where am I supposed to set the user's browser and browser version?

If os_name and os_version (which would be really odd naming though seems to be what your documentation at https://developers.amplitude.com/docs/http-api-v2 suggests), where am I supposed to define the operating system name and version?

This is what I'm currently doing but it seems ugly and doesn't distinguish between browser name and version:

    platform: `${userAgent.browser.name}@${userAgent.browser.major}`,
    os_name: userAgent.os.name,
    os_version: userAgent.os.version,
    device_brand: userAgent.device.vendor,
    device_model: userAgent.device.model,

And this is the data that I have available:

"userAgent.browser.major": "88",
    "userAgent.browser.name": "Chrome",
    "userAgent.browser.version": "88.0.4324.146",
    "userAgent.engine.name": "Blink",
    "userAgent.engine.version": "88.0.4324.146",
    "userAgent.os.name": "Mac OS",
    "userAgent.os.version": "10.15.7",
    "userAgent.ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36"

But it is unclear how to map these props to what Amplitude expects in the case of the browser name and version.

from amplitude-node.

kelvin-lu avatar kelvin-lu commented on August 20, 2024

@tommedema Let me confer with our dataPL team if we have any best practices but it looks close to what you have here - linking to what our Web SDK does here; we put the browser in the OS space and the OS info in the device.

what is userAgent.device.vendor look like? I don't think I see it in your available data

from amplitude-node.

tommedema avatar tommedema commented on August 20, 2024

Hmm, what you referred to me is actually different from what we're doing. It seems a bit awkward to say that the device model is MacOS, Windows, etc.? MacOS is an operating system, not a device. A device might be an iPhone, Samsung Galaxy S8, etc.

Even though it might not make sense to set the OS as the device, should we do this anyway since this seems to be what the web sdk does? FYI - seems like the web guys realize this is not correct

userAgent.device.vendor will be undefined unless you are on a mobile device, in which case it will be e.g. "Samsung", "Nokia", etc.

We use ua-parser-js to retrieve these properties from the user agent

from amplitude-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.