Mixpanel Community Icon

Tracking Events in Blue-Green Deployment for Web Apps

·
·

2 systems the old and new system all work as one web app, how do I track events across this blue green deployment approach that allows easy transition from A to B. Isn't there a logic for how the session unique identifiers are created.

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

    Hi B, Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹

    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
    ·
    ·

    To track events across a blue-green deployment approach with two systems functioning as one web app, you need to carefully manage user identities and session tracking. Here's how you can approach this using Mixpanel: 1. User Identity Management: The key is to maintain consistent user identification across both systems. Mixpanel uses a "Distinct ID" to uniquely identify users. For server-side tracking, which is likely in your case, you need to generate and manage these IDs yourself.Identifying Users (Original) provides guidance on server-side identity management: - Generate a unique anonymous ID (e.g., UUIDv4) for each user session. - Use this ID as the distinct_id for anonymous events. - When a user authenticates, send an $identify event to merge the anonymous ID with the authenticated user ID.2. Session Tracking: Mixpanel offers several ways to define sessions. For your blue-green deployment, a property-based session approach might be most suitable.Property-Based Sessions explains: - Choose a property (e.g., "session_id") to define your sessions. - The session persists as long as this property's value remains constant. - When the value changes, a new session starts.This approach allows you to control session boundaries explicitly, which can be helpful when transitioning between systems.3. Consistent Tracking Across Systems: Ensure that both your old and new systems use the same logic for generating and managing user IDs and session IDs. This consistency is crucial for maintaining accurate user journeys and analytics as users transition between systems.4. Data Validation: As you implement this approach, it's important to validate your data. Debugging Discrepancies suggests comparing data between systems, drilling down into specific time frames or user segments to identify and resolve any inconsistencies.Remember, the exact implementation will depend on your specific setup and requirements. The key is maintaining consistent user and session identification across both systems to ensure seamless tracking during your blue-green deployment.

    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.