Google analytics
Hello everyone, I have small problem with analytic i hope you guys can help me. So i start at start :D First of all i downloaded public googleanalyticsv3 u can watch it Link Here. And next i followed these steps what are there and filled all fields.
And i made new script to analytic screen. To make code i used their public site Link Here
Code Here:
using UnityEngine;
using System.Collections;
public class dde : MonoBehaviour {
public GoogleAnalyticsV3 googleAnalytics;
// Use this for initialization
void Start () {
googleAnalytics.LogScreen("Main Menu");
//Builder Hit with all App View parameters (all parameters required):
googleAnalytics.LogScreen(new AppViewHitBuilder()
.SetScreenName("Main Menu"));
}
// Update is called once per frame
void Update () {
}
}
I dont really get what is wrong, i hope i will get some help here
Looking forward for you'r answear
Answer by Bafelmauk · Nov 25, 2015 at 04:44 PM
you should have this code under Analytics.cs file
using UnityEngine;
using System.Collections;
public class Analytics : MonoBehaviour {
private GoogleAnalyticsV3 googleAnalytics;
public string gameName;
public string sceneName = "";
void Start()
{
googleAnalytics = this.gameObject.GetComponent<GoogleAnalyticsV3> ();
googleAnalytics.LogScreen (sceneName);
googleAnalytics.LogScreen (new AppViewHitBuilder ()
.SetScreenName (sceneName));
googleAnalytics.LogEvent ("Play", gameName, sceneName, 1);
}
}
and make sure androidmanifest have these lines
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Your answer
Follow this Question
Related Questions
Admob unity 2017.3 compile error 0 Answers
Why does my game crash on my mobile when I try to load the scene with this interstitial ad script? 0 Answers
NullReferenceException: Object reference not set to an instance of an object Problem! 0 Answers
firebase analytics does not register events called manually 1 Answer