简体   繁体   English

适用于Android的Google跟踪代码管理器

[英]Google Tag Manager for Android

I implement Google Tag Manager on my project .When i work on emulator all events come faster in Google anlyatics account shown which page open,but problem is that when i use in real device its taking more time to show the events,its taking around 2-5 mins. 我在项目上实现了Google跟踪代码管理器。当我在模拟器上工作时,所有事件会在显示了打开页面的Google分析帐户中更快地显示出来,但是问题是,当我在真实设备中使用它需要花费更多的时间来显示事件时,大约需要2个时间-5分钟

I am using like that can any tell me why its not working in real device. 我正在使用那样可以告诉我为什么它不能在真实设备中工作。 & also can any one help me out how to implement E commerce tracking in android app. 并且还可以帮助我解决如何在android应用中实现电子商务跟踪的问题。

DataLayer dataLayer = TagManager.getInstance(context).getDataLayer();
dataLayer.push(DataLayer.mapOf("event", "openScreen",
                    "screenName", "Home Screen"));       
GoogleAnalytics.getInstance(context).setLocalDispatchPeriod(5);

I'm not entirely sure, since I don't develop your Android, but for iOS using Google Tag Manager (and Google Analytics for that matter) the mobile platform is not pushing events in realtime, but they batch the data and send them every other minute or so. 我不确定,因为我不开发您的Android,但对于使用Google跟踪代码管理器(以及Google Analytics(分析))的iOS,移动平台无法实时推送事件,但它们会批量处理数据并每次发送一分钟左右。 For me the emulator in iOS does the same, ie it sends data every other minute and the same on device. 对我而言,iOS中的仿真器执行相同的操作,即每隔一分钟发送一次数据,并且在设备上发送相同的数据。 Maybe the emulator in Android is different in this regard, but I believe that mobiles do not send data in realtime at all, but batches a chunk of data and send it at the same time. 也许Android的模拟器在这方面有所不同,但是我相信移动设备根本不实时发送数据,而是分批处理数据并同时发送。

I don't think there is any way to go around this. 我认为没有任何办法可以解决此问题。 Correct me if I'm wrong though, but that's what I read somewhere in the documentation. 如果我错了,请纠正我,但这就是我在文档中读到的内容。 Can't seem to find the reference though. 似乎找不到参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM