- Home /
error CS0103: The name `Analytics' does not exist in the current context
I am including UnityEngine.Analytics on the top of the file
using UnityEngine;
using UnityEngine.Analytics;
but when trying to access
Analytics.CustomEvent()
I get an error:
Assets/Scripts/Services/GameTracker.cs(44,17): error CS0103: The name `Analytics' does not exist in the current context
To make sure I am not missing something I double checked documentation from: http://docs.unity3d.com/ScriptReference/Analytics.Analytics.CustomEvent.html
Unity doesn't recognize Analytics namespace after update to 5.2. Any ideas / fixes?
Answer by Xarbrough · Sep 29, 2015 at 05:31 PM
Did you tun on Analytics in the Services tab? Go to Window -> Unity Services, log in with your id and turn on Analytics. This is new in 5.2. Assemblies will only be loaded when the options are active.
Dude thank you. As someone new to this it was very helpful!
Seeing same error with our Jenkins build. It's fine locally. I logged into Unity with same account as on my desktop. Analytics is enabled on Services tab and project id in ProjectSetting.asset is correct
@scott-plutovr maybe you need to reimport after logging in?
There's a bug with Unity 5.6.6f2 where custom events through the Analytics Event Tracker
do work, but assemblies fail to load. I confirm the exact same setup fails on 5.6.6f2 but succeeds on 2018.3.0f2. (yup, revived an pretty old project). $$anonymous$$ind of sad that the last 5.6 stable version doesn't support analytics anymore.