Help! Integrate Google Analytics with Expo

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

Hi! According to http://native.directory, GitHub - rnc-archive/react-native-google-analytics: Google Analytics for React Native! Compatible with react-native-ab is compatible with Expo. If you have problems with that, post back?

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?

@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.

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.

Hi, you also can use

https://github.com/ryanvanderpol/expo-analytics

3 Likes

Hey ! Do u have any example or snack ! i m a beginner and i can use some help please ! i tried expo-analytics , but i cant find any thing on the GA dashboard , any Help !