Amplitude analytics not connecting to my React Native App

779 Views Asked by At

I have a react native app that uses expo so Amplitude is kind of built in. I thought all I had to do was initialize to get basic info flowing. Now 18 hours after pushing code to my users, Amplitude still says “Listening for first event”. All I’ve done is initialized, which I hoped would give me basic info about users connecting to my app like DAUs. I initialized in componentDidMount in app.js. Here is my code:

import Amplitude from 'expo';

export default class App extends React.Component {


componentDidMount() {

   Expo.Amplitude.initialize('my API Key');

}


  render() {
    return (
      <View style={styles.container}>
        <StatusBar
          barStyle="dark-content"
        />
      <Ladder />
      </View>
    );
  }
}
1

There are 1 best solutions below

0
On

Initialisation is ok in componentDidMount but you need to log at least one event.

Try to add Expo.Amplitude.logEvent('TEST_EVENT') after Amplitude initialisation.