firebase / firebase/firebase-ios-sdk

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

Open
#15,246 1 comment 1 reaction 0 assignees View on GitHub
api: analytics type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.