将 Google Analytics 与 FireBase + Google Tag Manager Android SDK 结合使用 [英] Using Google Analytics with FireBase + Google Tag Manager Android SDK

查看:24
本文介绍了将 Google Analytics 与 FireBase + Google Tag Manager Android SDK 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Android 中使用 Firebase + Google Tag Manager SDK 触发 Google Analytics 标签?我将 Firebase 容器添加到了我的 assets/container 文件夹,并使用我的 GA 跟踪 ID 创建了一个 Google Analytics 标签.我完全按照本教程中给出的步骤操作:https://developers.google.com/tag-manager/ios/v5/#introduction

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

我使用以下代码触发 appLaunch 事件:
mFirebaseAnalytics.logEvent("appLaunch", null);

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

如何在我的 Google Analytics(分析)报告中看到这一点?如果错了,请纠正我.以下是执行上述代码时打印的日志.

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:未找到标签管理器,因此不会使用
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase D/FA: 记录事件 (FE): appLaunch, Bundle[{_o=app}]
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA:使用测量服务
05-29 04:01:19.947 10378-10419/com.aiswarya.firebase V/FA:连接到远程服务05-29 04:01:19.967 10378-10419/com.aiswarya.firebase D/FA:连接到远程服务
05-29 04:01:19.967 10378-10419/com.aiswarya.firebase V/FA:处理排队的服务任务:1

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

提前致谢!

推荐答案

您应该为 FirebaseAnalytics 和 Google Tag Manager 启用调试日志记录并查看 logcat.它可能会回答您的问题.

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

您可以启用 Scion 调试日志

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

在 Android Studio 调试日志中查看事件

TagManager 是一个独立于 Firebase Analytics 的库.为了在您的应用程序中使用它,您需要添加对 Google Play 服务的标签管理器的依赖.当 Firebase Analytics 启动时,它会检查应用程序中是否存在 TagManager 并在 logcat 中打印消息.如果未找到消息打印 TagManager,则说明您的应用程序中没有 TagManager.当 TagManager 可用时,您将看到类似TagManager found,正在初始化"的消息

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"

这篇关于将 Google Analytics 与 FireBase + Google Tag Manager Android SDK 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆