# 1. Initiate Tracking Session If the user is logged in and has agreed to tracking in the app, check if a tracking session is active. This could be a stored cookie or the session token `__Secure-jay_tracking`. The session identifier should be stored in the app to be send with each request to the Playout-API. If the session is not present or expired, a new tracking session needs to be created. If the user has agreed to tracking, the tracking session should be created with the optional parameter `user_id` to associate the session with a logged-in user of the streaming platform. So the `user_id` needs to be provided by the implementing app. Tracking Session ## Check Active Tracking Session ### Response 200 - Active Session If the session ist still active, the response will be 200 OK with the session details. ```json { "sessionId":"550e8400-e29b-41d4-a716-446655440000", "startTime":"2023-01-15T14:30:24.123456", "source":"jay.api.playout.1.0.0", "userId":"user-123456" } ``` ### Response 400 - No Active Session If the session is not active or the cookie is not present, the response will be 400 Not Found. ```json { "error": { "code": "1001", "message": "No tracking session found or session data is invalid", "details": "TRACKING_NOT_VALID" } } ``` ## Create New Tracking Session If no active session is found, a new tracking session needs to be created. The `user_id` parameter should be an encrypted or hashed value to ensure user privacy. Basic Flow Overview of the complete basic flow. 2. Retrieve Episode Products How to retrieve episode products.