Home > @firebase/analytics > logEvent
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.
Signature:
export declare function logEvent(analyticsInstance: Analytics, eventName: 'purchase' | 'refund', eventParams?: {
value?: EventParams['value'];
currency?: EventParams['currency'];
transaction_id: EventParams['transaction_id'];
tax?: EventParams['tax'];
shipping?: EventParams['shipping'];
items?: EventParams['items'];
coupon?: EventParams['coupon'];
affiliation?: EventParams['affiliation'];
[key: string]: any;
}, options?: AnalyticsCallOptions): void;
Parameters
Parameter | Type | Description |
---|---|---|
analyticsInstance | Analytics | |
eventName | 'purchase' | 'refund' | |
eventParams | { value?: EventParams['value']; currency?: EventParams['currency']; transaction_id: EventParams['transaction_id']; tax?: EventParams['tax']; shipping?: EventParams['shipping']; items?: EventParams['items']; coupon?: EventParams['coupon']; affiliation?: EventParams['affiliation']; [key: string]: any; } | |
options | AnalyticsCallOptions |
Returns:
void