Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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!

like image 737
aiswarya Avatar asked May 27 '16 08:05

aiswarya


1 Answers

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"

like image 110
djabi Avatar answered Sep 20 '22 18:09

djabi