betaacid / expo-analytics

Google Analytics integration for use with React Native apps built on Expo
MIT License
286 stars 64 forks source link

Events not working during app lifetime #52

Open PiotrSzlagura opened 4 years ago

PiotrSzlagura commented 4 years ago

Hello

I have following issue: when I do something like:

let analytics = new Analytics("UA-XXXXXXXX-X");

analytics
  .event(
    new Event("test", "event", "ga-event")
  )
  .then(() => {
    console.log("event sent");
  })
  .catch(error => {
    console.log(error);
  });

in my RootComponent.componentDidMount, event is sent correctly and I can see it in my Analytics console.

But if I do the same after some event in my app, nothing happens. I do get console.log with text event sent which should indicate successfull send, but I can't see any event in my Analytics console.

Anyone had similar problem? Am I doing something wrong?