voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
35 lines (23 loc) • 1.45 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/analytics](./analytics.md) > [logEvent](./analytics.logevent_16.md)
## logEvent() function
Sends analytics event with given `eventParams`<!-- -->. 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 gtag.js reference documentation](https://developers.google.com/gtagjs/reference/event)<!-- -->.
<b>Signature:</b>
```typescript
export declare function logEvent(analyticsInstance: Analytics, eventName: 'share', eventParams?: {
method?: EventParams['method'];
content_type?: EventParams['content_type'];
content_id?: EventParams['content_id'];
[key: string]: any;
}, options?: AnalyticsCallOptions): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| analyticsInstance | [Analytics](./analytics.analytics.md) | |
| eventName | 'share' | |
| eventParams | { method?: [EventParams](./analytics.eventparams.md)<!-- -->\['method'\]; content\_type?: [EventParams](./analytics.eventparams.md)<!-- -->\['content\_type'\]; content\_id?: [EventParams](./analytics.eventparams.md)<!-- -->\['content\_id'\]; \[key: string\]: any; } | |
| options | [AnalyticsCallOptions](./analytics.analyticscalloptions.md) | |
<b>Returns:</b>
void