How to integrate GTM with Firebase analytics enabled Application which developed using Xamarin Android platform

1.1k views Asked by At

I am developing Mobile application using Xamarin Android. We have integrated Firebase portal with our application successfully. Also we are able to see all automated event and custom event on Dashboard in firebase Console.

Now my requirement is to integrate Google Tag Manager(GTM) SDK with existing Firebase SDK in my application. I tried to integrate by following some below links

https://developers.google.com/tag-manager/android/v5/

https://github.com/IdoTene/XamarinTagManagerAndroid

but ended up with build error Invalid Resource file Name for GTM configuration file(GTM-XXXX.json).

So here is my question, How to integrate GTM SDK with Firebase SDK in Xamarin Android application. Please any help would be greatly appreciated.

2

There are 2 answers

0
Sune Kjærgård On

I don't know if you figured it out eventually, but for future reference, the problem is that the IdoTene tagmanager project is for tagmanager v4, which is pre firebase. Instead you should use the version that Xamarin maintains:

https://www.nuget.org/packages/Xamarin.GooglePlayServices.TagManager/

1
DonMithila On

The steps are very simple. Integrate GTM containers (ios and android) as follows:

For Android -> create subfolder in assets folder and name it as containers, copy container in it (make sure it's naming starts with GTM-xxxxxx.json).

For iOS -> create a folder container in the root directory and copy GTM container json there (GTM-xxx.json)

Then install Xamarin.GooglePalyServices.TagManager nuget for Android and Xamarin.Google.iOS.Tagmanger for iOS.

Thats it for Android, but for iOS, there is a one more step.

Integrate following code in AppDelegate.cs Google.TagManager.TagManager.Configure();

Then you should be good to go!! :)