Skip to content

[FR]: Analytics + sGTM - Add support for specifying a destination per analytics event (Default vs. Server) #15246

@JanioPG

Description

@JanioPG

Description

The Firebase Analytics SDK currently requires developers to choose a single destination for all analytics events. The entire data stream is sent either to the Google Analytics default endpoint or is redirected to a custom server-side Google Tag Manager (sGTM) endpoint.

This "all-or-nothing" approach presents a challenge for developers who want to optimize both cost and functionality. A common and ideal workflow is to split traffic at the source:

Send high-value events (e.g., purchase) to the sGTM endpoint for robust server-side processing and integration with other APIs.

Send high-volume standard events (e.g., screen_view, user_engagement) directly to the Google Analytics default endpoint to avoid unnecessary sGTM server costs.

This feature would allow developers to implement this hybrid strategy directly in the app using the Firebase Analytics SDK, providing granular control over data flow.
It would also not be necessary to implement manual event sending to the sGTM endpoint.

API Proposal

Perhaps add an optional parameter to the logEvent method that explicitly specifies one of two destinations: the default GA4 servers or the configured sGTM server.

Firebase Product(s)

Analytics

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions