3

I want to use firebase analytics in react native. I have added the lib, but when i use the await analytics().logEvent("event_name") it returns null and event is also not added in firebase analytic console.

Any one have any idea what's wrong?

<Button
     title="Add To Basket"
     onPress={async () =>
       await analytics().logEvent('basket', {
         id: 3745092,
         item: 'mens grey t-shirt',
         description: ['round neck', 'long sleeved'],
         size: 'L',
       })
     }
   />

1 Answer 1

2

I had the same issue when I started with analytics.

Firebase says it takes around 24 hours for the events to be visible on console.

Also the logEvent has a return type of void, hence you see null being returned. So don't worry regarding that aspect unless you have an error.

So, I would suggest you to wait for the changes to be reflected.


For Development purposes we would need to see Realtime events, and Firebase has DebugView for that. For details, refer this document: https://firebase.google.com/docs/analytics/debugview

1
  • Thank you for help sir. got it
    – Milan837
    Commented Jan 28, 2021 at 11:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.