Skip to content Skip to sidebar Skip to footer

Using Google Analytics With Firebase + Google Tag Manager Android Sdk

How to fire Google Analytics tag using Firebase + Google Tag Manager SDK in Android? I added the Firebase container to my assets/container folder and created a Google Analytics ta

Solution 1:

You should enable debug logging for both FirebaseAnalytics and Google Tag Manager and look at the logcat. It will likely answer your question.

You can enable Scion debug logs

  adb shell setprop log.tag.FA VERBOSE
  adb shell setprop log.tag.FA-SVC VERBOSE
  adb shell setprop log.tag.GoogleTagManager VERBOSE
  adb logcat -v time -s FA FA-SVC GoogleTagManager

View events in Android Studio debug log

TagManager is a separate library from Firebase Analytics. In order to use it in your app you need to add dependency on the tag manager form Google play services. When Firebase Analytics starts it will check for the presence of TagManager in the app and print message in logcat. If the message print TagManager not found you don't have the TagManager in your app. When TagManager is available you will see message like "TagManager found, initializing"

Solution 2:

Google Tag Manager needs to be added as a separate dependency; see the documentation for doing so here:

Google Tag Manager for Android

In short:

  1. Add to your module's gradle file:

    dependencies {
      // ...
      implementation 'com.google.android.gms:play-services-tagmanager:[latest-version]'
    }
    
  2. Download the container file and add it to /assets/containers.

Post a Comment for "Using Google Analytics With Firebase + Google Tag Manager Android Sdk"