No Analytics Event Tracker

Hello everyone !

For a student videogame project, i’d like to use Analytics (for easing some testing protocols in a situation and a time that are ours now), but i am meeting some trouble with it.

First of all, every tutorial and documentation i’ve been watching tells me to use the Analytics Event tracker, but it appears that it doesn’t appear in my test projects.

Is it normal ? Do we have to take it from an external source ? How can i do without it ?

For some context, i have been testing it on 2019 3.3f1 and 2020.0.1b6

You would not want to use the Event Tracker for now. Instead, just use the following syntax in your scripts:

Analytics.CustomEvent(“MyEvent”);

Thanks for the reply !
If i have understood i include that syntax and the events i’d like to implement directly in the concerned gameobjects right ?
Can I use standard events with that method too ?

Yes https://docs.unity3d.com/Manual/UnityAnalyticsStandardEvents.html

Are the Tracker still not usable?

Correct, you’ll want to use scripted custom events

Thank you

Hi, does this mean that we cant use standard events? Only CustomEvents are available to use?

I found this thread after searching that I could not add standard events in my game.

After adding using UnityEngine.Analytics;, there is no such thing as AnalyticsEvent, so I cant add any of the standard events

The Tracker is available as a script, choose Add Component from the Inspector and choose the Analytics section, you’ll find it there.

1 Like

I tried to do this, there aren’t any componente from analytics.

What Am I missing?

Did you install the Analytics package in Package Manager? What version of the package, and what version of Unity are you using?

1 Like

Thanks. So I cant use the standard events in code? However the code example in the documentation makes it seem that we can use it in code: https://docs.unity3d.com/Manual/UnityAnalyticsStandardEvents.html

Yes, you can certainly use standard events as the documentation states. I just installed Analytics Library 3.6.11 (the latest) and see the AnalyticsEvent top level object and able to write code exactly as in the documentation. I’m using Unity 2019.4 and it should be available in recent versions also.

Thanks for the reply, but I cant seem to use it.

I’m using Unity 2020.3.15f2 and Analytics library 3.5.3 (which is the latest one being shown to be in package manager and has the verified text next to it).

In my code I have written using UnityEngine.Analytics;, but as can be seen from the screenshot below AnalyticsEvent is not available to me.

What am I doing wrong?

7451024--914078--bad_analytics.jpg

Can you try with 3.6.11 ?

I just installed Unity 2020.3.15 and confirmed that AnalyticsEvent is present in Analytics Library 3.5.3. Are you using Visual Code? It sounds like your Intellisense may not be behaving correctly. I’m using Visual Studio. If you save the script regardless of errors in your editor, does Unity also complain?

I’m using Visual Studio 2019. And yes If I just type AnalyticsEvent.GameStart(); I get the error:

Its strange that Intellisense will pick up AnalyticsEventPriority which is from UnityEngine.Analytics, but it wont pick up AnalyticsEvent???

Please try my suggestion to confirm. Also please try with a brand new/empty project to make sure there are no namespace collisions. Also try deleting the /Library folder and allow it to rebuild. Also try edit > preference > external tools > recreate project file

1 Like

Deleting /Library folder fixed it. I can now see AnalyticsEvent in my code.

Many thanks :slight_smile:

1 Like

Fixed too, deleted /Library folder, and now it is fixed.