You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add implementation of getGoogleAnalyticsClientId (#7158)
* Add initial implementation of getGoogleAnalyticsClientId
* Update docs devsite
* Add checkset
* Update changeset description
* Add link to client_id in docstring
* Update gtagWrapper to take variable number of args for potential fallthrough case
* Add API test for getGoogleAnalyticsClientId
* Move API functionality to internal function
* Update docs for devsite
* Removed unused function in test
* Update public api with async keyword
* Remove comment
* Update doc string
* Update grammar of changeset
* Remove console.log
* Update variable name from targetId to measurementId
* Removed check for blank measurementId
* Add ERROR_FACTORY for promise rejection
* Change fieldName from clientId
* Update AnalyticsError.NO_CLIENT_ID message
* Testing adding comment
* remove test comment
* Remove comments
Add method `getGoogleAnalyticsClientId()` to retrieve an unique identifier for a web client. This allows users to log purchase and other events from their backends using Google Analytics 4 Measurement Protocol and to have those events be connected to actions taken on the client within their Firebase web app. `getGoogleAnalyticsClientId()` will simplify this event recording process.
Copy file name to clipboardexpand all lines: docs-devsite/analytics.md
+21
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ Firebase Analytics
20
20
|[getAnalytics(app)](./analytics.md#getanalytics)| Returns an [Analytics](./analytics.analytics.md#analytics_interface) instance for the given app. |
21
21
|[initializeAnalytics(app, options)](./analytics.md#initializeanalytics)| Returns an [Analytics](./analytics.analytics.md#analytics_interface) instance for the given app. |
22
22
| <b>function(analyticsInstance...)</b> |
23
+
|[getGoogleAnalyticsClientId(analyticsInstance)](./analytics.md#getgoogleanalyticsclientid)| Retrieves a unique Google Analytics identifier for the web client. See [client\_id](https://developers.google.com/analytics/devguides/collection/ga4/reference/config#client_id)<!---->. |
23
24
|[logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent)| Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!---->List of recommended event parameters can be found in [the GA4 reference documentation](https://developers.google.com/gtagjs/reference/ga4-events)<!---->. |
24
25
|[logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent)| Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!---->List of recommended event parameters can be found in [the GA4 reference documentation](https://developers.google.com/gtagjs/reference/ga4-events)<!---->. |
25
26
|[logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent)| Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!---->See [Track Screenviews](https://firebase.google.com/docs/analytics/screenviews)<!---->. |
Retrieves a unique Google Analytics identifier for the web client. See [client\_id](https://developers.google.com/analytics/devguides/collection/ga4/reference/config#client_id)<!---->.
Sends a Google Analytics event with given `eventParams`<!---->. This method automatically associates this logged event with this Firebase web app instance on this device.
0 commit comments