Google Analytics Unity不发送点击 [英] Google Analytics Unity Not Sending Hits

查看:175
本文介绍了Google Analytics Unity不发送点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人有使用Unity Google Analytics插件的经验吗?到目前为止,我一直没有发送匹配。



我使用的方法是将已初始化的GAv3预制件放置到资源/资源中,然后使用此代码附加到每个场景中的相机中以实例化它并发送屏幕名称。

  gav =(Instantiate(Resources.Load (GAv3))作为GameObject).GetComponent。< GoogleAnalyticsV3>(); 
gav.StartSession();
gav.LogScreen(Application.loadedLevelName);
gav.DispatchHits();

在详细模式logcat显示中:

初始化Google Analytics 1.0。



初始化Google Analytics Android Tracker。



记录屏幕。



但我没有看到任何实时或者等待48小时的视图。



我是否错过了一些东西?我的方法错了吗?

解决方案

确定我的2个问题的答案是:是和否。 b
缺少某些内容,并且我的方法存在 错误。 / p>

令我担心的是实例化方法可能会导致问题,因为它不是文档中描述的方法。事实证明,这不是问题。



什么是懒惰复制和粘贴的问题。当我从GA网站复制跟踪代码时,我不小心复制了下面的行。当它被复制到检查器中变量的单行文本框中时,跟踪代码如预期的那样显示,但是隐藏线也是字符串变量的一部分,无法看到。



给我打电话。



希望这个教训能够帮助另一个不小心的白痴避免相同或类似的错误。

Does anyone have experience of working with the Unity Google Analytics Plugin? So far I've had no luck at all in sending hits.

The method I'm using is to place the initialised GAv3 prefab into Assets/Resources and then to use this code attached to the camera in each scene to instantiate it and send the screen name.

gav=(Instantiate(Resources.Load("GAv3")) as GameObject).GetComponent.<GoogleAnalyticsV3>();
gav.StartSession();
gav.LogScreen(Application.loadedLevelName);
gav.DispatchHits();

In verbose mode logcat shows:

Initializing Google Analytics 1.0.

Initializing Google Analytics Android Tracker.

Logging Screen.

but I don't see anything arriving in the view either in real time or if I wait 48 hrs.

Am I missing something? Is my approach wrong?

解决方案

OK the answer to my 2 questions are: Yes and No.

I was missing something and there is nothing wrong with my approach.

What was worrying me was that the instantiate approach might be causing the problem as it isn't the method described in the documentation. It turns out that this was not the problem.

What was the problem was lazy copying and pasting. When I copied the tracking code from the GA website I accidentally also copied the line below. When this was copied into the single line textbox for the variable in the inspector the tracking code showed as expected but there was a hidden line that was also part of the string variable that couldn't be seen.

Slap me.

Hopefully this lesson learned helps another careless idiot avoid the same or similar mistake.

这篇关于Google Analytics Unity不发送点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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