Custom Events

Introduction

Lion Analytics supports the creation of custom events. Custom events often lead to redundancy and inefficiencies as they typically replicate existing predefined events or create niche events that are unnecessary.

Overview

Custom events are any events that:

  • Are not predefined in the Lion Analytics module.
  • Mimic predefined events but do not adhere to the standard event schema (i.e., they include different parameters).

Why Custom Events Should Be Limited

The Lion Analytics framework is designed to standardize event tracking to ensure efficient data processing and analysis. Using custom events can lead to several issues:

  • Redundancy: Custom events often duplicate the functionality of existing events.
  • Inefficiency: Custom events require additional work for ETL (Extract, Transform, Load) tasks and data modeling, impacting our ability to provide timely and accurate insights.
  • Data Consistency: Standard events ensure consistency in data collection, making it easier to maintain and analyze data across multiple games.

When to Use Custom Events

Custom events should only be considered when absolutely necessary and when no existing predefined event can fulfill the tracking requirement. Always refer to the predefined events first and consult the decision flow to determine if a custom event is needed.

Example Mapping

Instead of creating custom events, map your use cases to the predefined Lion Analytics events. Here are some examples:

Use CaseCustom EventStandard Event
Completing a task 
task_abc_completemission_complete → mission_name = “task_abc”
Trading an item for in-game currency 
sell_item → item_name = “costume 1” → earned_coins = 100economy → product_spent = “costume 1” → product_received = “coins” → received_amount = 100
Unlocking a new level 
unlocklevel.10feature_unlocked → feature_type = “level” → feature_name = “10”
Reaching a high score 
score.50achievement → achievement_name = “score.50”
Purchasing an IAP 
iap.com.bundle.starterinapp_purchase → product_id = “iap.com.bundle.starter”