Using Google Analytics with FireBase + Google Tag Manager Android SDK

13,774

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"

Share:
13,774
aiswarya
Author by

aiswarya

Updated on June 17, 2022

Comments

  • aiswarya
    aiswarya almost 2 years

    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 tag using my GA Tracking id. I have followed exactly the steps as given in this tutorial: https://developers.google.com/tag-manager/ios/v5/#introduction

    I trigger the appLaunch event with the below code:
    mFirebaseAnalytics.logEvent("appLaunch", null);

    How can I see this in my Google Analytics report? Please correct me if am wrong. Below are the logs printed when the above code is executed.

    05-29 04:01:19.947 10378-10419/com.aiswarya.firebase I/FA: Tag Manager is not found and thus will not be used
    05-29 04:01:19.947 10378-10419/com.aiswarya.firebase D/FA: Logging event (FE): appLaunch, Bundle[{_o=app}]
    05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA: Using measurement service
    05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA: Connecting to remote service 05-29 04:01:19.967 10378-10419/com.aiswarya.firebase D/FA: Connected to remote service
    05-29 04:01:19.967 10378-10419/com.aiswarya.firebase V/FA: Processing queued up service tasks: 1

    Thanks in Advance!

  • aiswarya
    aiswarya almost 8 years
    Thanks djabi. I have already enabled all these logs. But only the FA logs are seen.
  • djabi
    djabi almost 8 years
    When Firebase Analytics starts it prints a message if it finds the TagManager in the app. If it prints "TagManager not found" you did not link to the tag manager library. Check your app/build.graddle file. TagManager is not part of the Firebase Analytics library. You need to explicitly add it as dependency.
  • djabi
    djabi almost 8 years
    Great, let me update the answer with the recommendation to check the dependency on the TagManager.