Help! Integrate Google Analytics with Expo

#1

We want to integrate google analytics with our expo app but apparently some of the libraries available are not compatible with Expo (e.g. react-native-google-analytics-bridge).

May I know an alternative way for us to use Google Analytics into our app? We’ve been using it in all of our apps so we don’t want to stay away from it. Thanks

#2

Hi! According to http://native.directory, https://github.com/lwansbrough/react-native-google-analytics is compatible with Expo. If you have problems with that, post back?

#4

Hi,

I tried the React Native Google Analytics Library and it works for the most part. The part that I cant seem to get to work is the react-native-device-info library which is needed for things like

import DeviceInfo from 'react-native-device-info';

DeviceInfo.getReadableVersion(),
DeviceInfo.getBundleId()

Expo doesn’t seem to like this library and detect it even if i install and save it. It seems like it needs some kind of linking that I am unsure Expo provides at the moment. Do I need to detach the app to be able to use this feature?

#5

@arjunrao87 you’re right, to use react-native-device-info you need to use linking (per the documentation here: https://github.com/rebeccahughes/react-native-device-info). Expo does not support linking.

#6

Has anybody solved this issue yet?

react-native-google-analytics-bridge is clear:

Important: Does this library work with Expo? We have to sort of invert the question a bit, because it should be: does Expo work with other libraries? And the answer is no:

The most limiting thing about Expo is that you can’t add in your own native modules without detaching and using ExpoKit.

This includes using create-react-native-app which also makes use of Expo.

#7

Hi, you also can use

1 Like