Oleksandr
Oleksandr

Reputation: 293

Firebase+GTM SDK - accessing GA tracker Client ID

I am implementing v5 Firebase+GTM SDK with the sole purpose of tracking the events in Google Analytics. I can't seem to find a way to access GA Client ID (using previous versions of GTM SDK, I was able to access tracker object and get or set the value). I am talking about this value: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid

Is there a way to reach to GA object hidden inside FIRAnalytics?

Upvotes: 2

Views: 1194

Answers (2)

Dmitry
Dmitry

Reputation: 792

Yeah, I don't think tracker object is surfaced.

What you can do is to generate your own clientID (a simple guid would do) and in Google Tag Manager configure a tag to set it as a field. This way you will fully control the cliend id (&cid) and therefore change it as you see fit

Upvotes: 3

AniV
AniV

Reputation: 4037

This is not possible as of today, since Firebase does not expose data via a REST API. There is no API to even pass on the GA client ID.

From GTM's side of things, that is again a closed system since the data from Firebase is intercepted by GTM but cannot be pulled out or tweaked before it is passed to GA.

Upvotes: 0

Related Questions