Is it possible to add properties tracked on the client side to the server-side such as screen height and screen width? kapa.ai
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.
You can use a User-Agent parsing library for your server-side language to extract this information.
3. Super Properties: If you're using a combination of client-side and server-side tracking, you can set these properties as Super Properties on the client side. These will persist across requests and be included in subsequent events.
4. Borrowed Properties: Mixpanel offers a feature called Borrowed Properties that allows you to "borrow" properties from one event to another on the fly. This could be useful if you have these properties tracked in some client-side events and want to use them in your server-side events.
Remember, when implementing server-side tracking, it's important to consider what client-side information you need and plan how to capture and pass that data to your server. As the Server-Side Best Practices guide suggests, you may need to write some custom code to track and maintain this information across requests.
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.
