Multiple tracker support + much more!
Okay this is a huge release. Thanks to the fantastic work by @MrBr, we now have support for multiple trackers! 🏆
From now on, you will have to construct the GoogleAnalyticsTracker
class:
import { GoogleAnalyticsTracker } from 'react-native-google-analytics-bridge';
let tracker = new GoogleAnalyticsTracker('UA-12345-1');
This means the old way of using the tracker statically, GoogleAnalytics.trackScreenView('Home')
, is deprecated. It's not a breaking change yet, but I recommend updating your code since that will probably be removed in a later version. This also means that setting your trackerId
natively in Info.plist etc is deprecated.
Things have also been moved around a bit, a few settings methods have been moved to the new GoogleAnalyticsSettings
type. It is still used statically since settings are applied across all trackers.
Also since the previous release we now have trackMultiProductsPurchaseEventWithCustomDimensionValues
added to the tracker, courtesy of @malaman. 💪 Thanks!