Google Analytics for Android v4 - Automatic Screen Measurement not working?

隐身守侯 提交于 2019-12-05 04:40:14
Kevin

Well, a little more searching on SO and I found a workaround here

It sounds like there's a bug in GA. But making a call to enableAutoActivityReports on GoogleAnalytics class seems to take care of it. Once I did that in my application class, the automatic screen views showed up, and the screen names were correctly mapped as configured in my tracker XML.

Note that enableAutoActivityReports says it's only for API 14 (ICS) and above. Not sure what Gingerbread is supposed to do.

I am the original answerer from the question that kevin linked to.

A few things:

  • The sample app is a little misleading because it uses fragments and enableAutoActivityReports only works with Activities. I would like to fix it at some point but not sure when I'll be able to.
  • If you would like auto activity to work on all the devices, you'll have to call reportActivityStart from onStart of each activity. I know it is tedious but given the constraints, not sure what else can be done. If you do call reportActivityStart, it will do the right things and be a noop for newer devices.

feel free to ask more questions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!