Mixpanel Community Icon

Adding Client-Side Properties to Server-Side Tracking

·
·

Is it possible to add properties tracked on the client side to the server-side such as screen height and screen width? kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Please stand by Bernie as I search the knowledge base. I normally take about 15 seconds or so. đź‘‹

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Yes, it is possible to add client-side properties like screen height and screen width to server-side tracking in Mixpanel. This can be achieved through a few different approaches:1. Manual Tracking: You can manually pass client-side properties to your server and then include them in your server-side tracking calls to Mixpanel. This requires you to send these properties from the client to your server with each request.2. User Agent Parsing: For properties like screen dimensions, you can parse the User-Agent string on the server side. Many server frameworks provide access to this information. As mentioned in the Server-Side Best Practices documentation: ``` Mixpanel's Web and Mobile SDKs parse User-Agent into a set of properties about the user's browser, device, and OS. This doesn't happen automatically with server-side tracking, but it's easy to add these properties yourself.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.