firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

Firebase Analytics logEvent with custom parameters map issues

Open andreimesina opened this issue 10 months ago • 0 comments
trafficstars

Hi there! I'm using the Firebase Analytics from GitLive version 2.1.0 in a Kotlin with Compose Multiplatform - Kobweb project for a website.

I am trying to log the following event together with a map of custom parameters:

First attempt:

analytics.logEvent(
    "landing_cta_click",
    mapOf(
        "home_variant" to "A",
        "cta_variant" to "B"
    )
)

Second attempt:

analytics.logEvent("landing_cta_click") {
    param("home_variant" to "A")
    param("cta_variant" to "B")
}

Checking the Firebase DebugView, in first attempt they are logged under the v5_1 name: Screenshot 2025-01-03 at 14 08 08 Screenshot 2025-01-03 at 14 08 35

And for second attempt, they are logged under the internalMap_1 name: Screenshot 2025-01-03 at 14 52 30 Screenshot 2025-01-03 at 14 41 38

I expected that the home_variant and cta_variant custom parameters would be added directly to the landing_cta_click event log in Firebase as individual parameters, rather than being added under these unexpected container names.

This is a critical issue for my project because it totally breaks the Google Analytics custom parameters tracking, as for example home_variant is not considered a logged parameter even if it is set as a custom dimension. It just appears as (not set), because instead v5_1 is registered as the actual parameter, with a plain text value set to {home_variant=B, cta_variant=A}.

image

andreimesina avatar Jan 03 '25 13:01 andreimesina