Using Google Analytics with FireBase + Google Tag Manager Android SDK

前端 未结 2 1642
不知归路
不知归路 2020-12-31 19:15

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 creat

相关标签:
2条回答
  • 2020-12-31 19:22

    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.

    0 讨论(0)
  • 2020-12-31 19:26

    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"

    0 讨论(0)
提交回复
热议问题