0

I'm using the React Native firebase library for firebase analytics. I wanted to use Google Tag Manager also in my project for iOS application. Is there a way to integrate it into my project while I'm using react-native-firebase?

This link: https://developers.google.com/tag-manager/ios/v5/ gives me an explanation, but it will not work because react-native-firebase uses v5 of firebase library and Google Tag Manager uses v4 of the same library. I've also tried some third party libraries such as React Native analytics bridge, but no success, because it has poor documentation.

AmerllicA
  • 29,059
  • 15
  • 130
  • 154
cinemanja
  • 481
  • 6
  • 19

1 Answers1

0

Since you have already configured Firebase in your React Native project, implementing GTM is not a big issue. I am using this package https://www.npmjs.com/package/react-native-gtm in my application. It works perfectly, just follow the link along with the extra steps for iOS.

Note :

  • Just install react-native-gtm using npm, do not link it.
  • And yes, there is no proper documentation related to Google Tag
    Manager in React Native, most of the articles focus on Native
    implementation alone.
  • In the link, a sample event has below code. AFAIK, Firebase is supposed to automatically send events, right? Here, we'll need to manually code in such type of dataLayer pushes and then go to GTM to configure all hits + params [standard and custom] from there?? Thanks. GoogleTagManager.push({ event:"openScreen", screenName:"HomeScreen", appName:"HelloApp" }); – AdilK Jul 28 '21 at 14:13