Analytics (Android)
Analytics for Live2.ai tracks and analyzes user interactions and livestream performance to improve content and user experience.
Live2.ai Analytics
Before diving into analytics events, let's review how to register and unregister for analytics tracking on Live2.ai. Follow the steps in the Live2.ai documentation.
Now let's see how to subscribe to the specific analytics event:
To manage the lifecycle of the view efficiently, simply pass the LifecycleOwner. By doing so, the view will automatically be bound to its lifecycle, eliminating the need for manual registration or unregistration. This approach ensures that the view's lifecycle is properly handled, reducing the risk of memory leaks and simplifying the code.
API_REQUEST_START- Signifies the beginning of an API request.
API_REQUEST_END- Indicates the completion of an API request.
EMBED_LOAD_START- Signifies the beginning of the process to load an embedded content or resource.
EMBED_LOAD_FAIL- Indicates that the attempt to load an embedded resource has failed.
EMBED_LOAD_SUCCESS - Signifies that the embedding of content has been successfully completed without errors.
VIDEO_CONTROL_CLICK- Represents an event triggered when a user interacts with video control buttons, such as play, pause, or skip.
VIDEO_VIEW- Typically represents an event where a video has been viewed or interacted with in a media application.
VIDEO_SWIPE- Typically refers to an event where the user swipes across a video, often used to trigger interactions such as skipping, seeking, or revealing additional content.
PRODUCT_CTA_CLICK- Represents an event where a user clicks on a "Call to Action" button related to a product.
PRODUCT_CARD_CLICK- Typically indicates a user interaction with a product card, often triggering details or actions related to that product.
PLAYER_VIEW_LAUNCH- Indicating the initiation of a player view in a media application.
PRODUCTS_DETAILS_OPEN- Represents an event triggered when a user opens a product details page in an application or website.
CAMPAIGN_RESPONSE_SUBMIT- Represents an event indicating that a user has submitted a response or feedback related to a campaign.
CAMPAIGN_EXPAND_CLICK- Typically represents an event triggered when a user clicks to expand a campaign or promotional content.
Handling Specific Event Data in Your Application
To effectively handle particular event data, you need to manage the events through dedicated functions. Below is a structured approach to handle different levels of events (L2, L1, and Common events) with the corresponding code snippets:
1). Handling L2 Events Data
To capture L2 events data, implement the catchL2EventsData
function. This function uses a when
statement to handle various types of L2 events, such as video control clicks, video views, video swipes, product CTA clicks, and more.
2). Handling L1 Events Data
Similarly, to capture L1 events data, define the catchL1EventsData
function. This function is designed to handle events related to the embed load process, including start, success, and failure events.
3) Handling Common Events Data
For common events, use the catchCommonData
function. This function deals with API-related events, specifically the start and end of API calls.
Summary
By organizing event handling into distinct functions (catchL2EventsData
, catchL1EventsData
, and catchCommonData
), you ensure that each type of event is managed appropriately. This approach enhances code readability, maintainability, and scalability, making it easier to add or modify event handling logic in the future.
Last updated