Client SDKs

Custom Events

Track any custom event with the Android SDK

Track game-specific or app-specific events with arbitrary properties.

Basic Usage

AudienceLabSDK.sendCustomEvent(
    name = "level_complete",
    params = mapOf(
        "level" to 42,
        "score" to 15200,
        "stars" to 3
    )
)

AudienceLabSDK.sendCustomEvent(
    name = "achievement_unlocked",
    params = mapOf("achievement_id" to "first_win"),
    dedupeKey = "achievement_first_win_$userId"
)

Parameters

Prop

Type

Examples

Level Completion

AudienceLabSDK.sendCustomEvent(
    name = "level_complete",
    params = mapOf(
        "level" to 5,
        "score" to 12500,
        "difficulty" to "hard",
        "stars" to 3
    )
)

Tutorial Progress

AudienceLabSDK.sendCustomEvent(
    name = "tutorial_step",
    params = mapOf(
        "step" to "inventory_opened",
        "step_number" to 3,
        "total_steps" to 10
    )
)

With Deduplication

AudienceLabSDK.sendCustomEvent(
    name = "achievement_unlocked",
    params = mapOf("achievement_id" to "first_win"),
    dedupeKey = "achievement_first_win_$userId"
)

What Gets Sent

The SDK sends type: "custom" with payload containing en (event name) and pr (properties), plus common envelope fields (creativeToken, device info, ga/asid/aid, wp/bp, eid).

Best Practices

  • Use consistent event names for reliable filtering
  • Include relevant context in params
  • Use dedupeKey for one-time events