Skip to content

Fix analytics logEvent public signatures #4469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-suns-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'firebase': patch
---

Change the `eventParams` argument in the signature of `analytics().logEvent()` to be optional.
40 changes: 20 additions & 20 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4479,7 +4479,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'add_shipping_info',
eventParams: {
eventParams?: {
coupon?: EventParams['coupon'];
currency?: EventParams['currency'];
items?: EventParams['items'];
Expand All @@ -4500,7 +4500,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'add_to_cart' | 'add_to_wishlist' | 'remove_from_cart',
eventParams: {
eventParams?: {
currency?: EventParams['currency'];
value?: EventParams['value'];
items?: EventParams['items'];
Expand All @@ -4519,7 +4519,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'begin_checkout',
eventParams: {
eventParams?: {
currency?: EventParams['currency'];
coupon?: EventParams['coupon'];
value?: EventParams['value'];
Expand All @@ -4539,7 +4539,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'checkout_progress',
eventParams: {
eventParams?: {
currency?: EventParams['currency'];
coupon?: EventParams['coupon'];
value?: EventParams['value'];
Expand All @@ -4561,7 +4561,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'exception',
eventParams: {
eventParams?: {
description?: EventParams['description'];
fatal?: EventParams['fatal'];
[key: string]: any;
Expand All @@ -4579,7 +4579,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'generate_lead',
eventParams: {
eventParams?: {
value?: EventParams['value'];
currency?: EventParams['currency'];
transaction_id?: EventParams['transaction_id'];
Expand All @@ -4598,7 +4598,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'login',
eventParams: {
eventParams?: {
method?: EventParams['method'];
[key: string]: any;
},
Expand All @@ -4615,7 +4615,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'page_view',
eventParams: {
eventParams?: {
page_title?: string;
page_location?: string;
page_path?: string;
Expand All @@ -4634,7 +4634,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'purchase' | 'refund',
eventParams: {
eventParams?: {
value?: EventParams['value'];
currency?: EventParams['currency'];
transaction_id: EventParams['transaction_id'];
Expand All @@ -4658,7 +4658,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'screen_view',
eventParams: {
eventParams?: {
app_name: string;
screen_name: EventParams['screen_name'];
app_id?: string;
Expand All @@ -4679,7 +4679,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'search' | 'view_search_results',
eventParams: {
eventParams?: {
search_term?: EventParams['search_term'];
[key: string]: any;
},
Expand All @@ -4696,7 +4696,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'select_content',
eventParams: {
eventParams?: {
items?: EventParams['items'];
promotions?: EventParams['promotions'];
content_type?: EventParams['content_type'];
Expand All @@ -4716,7 +4716,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'select_item',
eventParams: {
eventParams?: {
items?: EventParams['items'];
item_list_name?: EventParams['item_list_name'];
item_list_id?: EventParams['item_list_id'];
Expand All @@ -4735,7 +4735,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'select_promotion' | 'view_promotion',
eventParams: {
eventParams?: {
items?: EventParams['items'];
promotion_id?: EventParams['promotion_id'];
promotion_name?: EventParams['promotion_name'];
Expand All @@ -4754,7 +4754,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'set_checkout_option',
eventParams: {
eventParams?: {
checkout_step?: EventParams['checkout_step'];
checkout_option?: EventParams['checkout_option'];
[key: string]: any;
Expand All @@ -4772,7 +4772,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'share',
eventParams: {
eventParams?: {
method?: EventParams['method'];
content_type?: EventParams['content_type'];
content_id?: EventParams['content_id'];
Expand All @@ -4791,7 +4791,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'sign_up',
eventParams: {
eventParams?: {
method?: EventParams['method'];
[key: string]: any;
},
Expand All @@ -4808,7 +4808,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'timing_complete',
eventParams: {
eventParams?: {
name: string;
value: number;
event_category?: string;
Expand All @@ -4828,7 +4828,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'view_cart' | 'view_item',
eventParams: {
eventParams?: {
currency?: EventParams['currency'];
items?: EventParams['items'];
value?: EventParams['value'];
Expand All @@ -4847,7 +4847,7 @@ declare namespace firebase.analytics {
*/
logEvent(
eventName: 'view_item_list',
eventParams: {
eventParams?: {
items?: EventParams['items'];
item_list_name?: EventParams['item_list_name'];
item_list_id?: EventParams['item_list_id'];
Expand Down