Not all custom events showing up

I now have most of my data coming through nicely, but I’ve noticed that one event that is created at startup is not.

I do 2 at the same time, recording some general information:

    var params = new Dictionary.<System.String, System.Object>();
    params.Add("title", title);
    params.Add("version", versionNumber);
    UnityAnalytics.CustomEvent("Product",params);
   
    params = new Dictionary.<System.String, System.Object>();
    params.Add("model",SystemInfo.deviceModel);
    params.Add("vendor",SystemInfo.graphicsDeviceVendor);
    params.Add("type",SystemInfo.deviceType);
    params.Add("version",SystemInfo.graphicsDeviceVersion);
    params.Add("os",SystemInfo.operatingSystem);
    UnityAnalytics.CustomEvent("Device",params);

But only the first one ever ends up in the analytic website.
Can you not create 2 events at the same moment?

Is there a way to get this type of information anyway without creating a custom event?
I notice in the Integration test area that OS etc. is reported but it’s not accessible for us to look at in the data explorer.

So it looks to me as if you’ve deleted this application, which makes it hard for me to investigate. Was this intentional?

[Edit]I’m presuming this because I see an app listed against your name, which is marked as deleted. Perhaps your application is different, listed against an organization to which you belong?[/Edit]

I created and deleted a test app yesterday. But I have another one listed under Primal Pictures which is my organisation.
That’s the one with the issue.

Looks to me like this line might be your problem. SystemInfo.deviceType returns a DeviceType Enum, not a string, and the SDK only accepts numbers, booleans and strings. Convert the Enum to a string and try again.

BTW, UnityAnalytics.CustomEvent has a return value that will tell you if a sent event is successful or not, including a broad explanation of why a failure occurred. Try logging that result…it’ll probably be informative (and hopefully prove me correct :slight_smile: ).

Ah! Cheers I will try that.
I would have expected an compile error though, no?

Analytics is designed to be very low-profile in most ways. The upside is that if you deploy to a platform we don’t support, or you accidentally create an analytics error in your app, we don’t bring you down. The downside is that we’re (perhaps over-) cautious about throwing errors.

I’m missing a lot of my custom events too, some show up but others won’t, and I copied and pasted them so I don’t know whats wrong. I’m also at 39 points for my analysis watcher.

heres an example of my code. MakeUp_Link_2 shows up, but not MakeUp_Link_1. The are both called from a button press.

    public void MakeUpLink1(){
        UnityAnalytics.CustomEvent("MakeUp_Link_1", new Dictionary<string, object>{

        });
        // this is for new tab in web player
//        Application.ExternalEval("http://www.theage.com.au/national/indias-mica-mines-the-shameful-truth-behind-mineral-makeups-shimmer-20140118-311wk.html','Window title')");
        // else this for tablet/PC
        Application.OpenURL("http://www.theage.com.au/national/indias-mica-mines-the-shameful-truth-behind-mineral-makeups-shimmer-20140118-311wk.html");
    }

    public void MakeUpLink2(){
        UnityAnalytics.CustomEvent("MakeUp_Link_2", new Dictionary<string, object>{

        });
        // this is for new tab in web player
//        Application.ExternalEval("http://www.simpleluxeliving.com/how-the-ultra-rich-global-cosmetics-industry-is-marred-by-practices-such-as-child-labour-and-sweatshops/','Window title')");
        // else this for tablet/PC
        Application.OpenURL("http://www.simpleluxeliving.com/how-the-ultra-rich-global-cosmetics-industry-is-marred-by-practices-such-as-child-labour-and-sweatshops/");
    }

Hi Cal2,

So it’s not entirely clear to me why this is happening, but I do have some thoughts and observations.

First thing to note is that when I look at your custom event validator, I see no evidence of either of these events. Are you sure you’re sending them?

Second, the Dictionary you’re sending is empty. It’s not adding anything helpful and should be removed.

Next, try logging the result of the UnityAnalytics.CustomEvent call. CustomEvent returns an Enum, letting you know what the system did with your call. It should return OK if everything worked out.

Finally, as a workaround, try sending the CustomEvent, then opening the URL only after a brief Coroutine timeout. When a user leaves a browser window, it goes into background. We attempt to flush custom events at this moment, but it’s possible that we’re not doing that properly in your case.

Ok, so I’m going to try and see if putting a “dontDestroyOnLoad” for the Integration script will make a difference. It does show up for the “Test & Validate” page either way, but I just noticed that only my events that are on the first level that loads the Integration script are showing up. So maybe on the Android phone/Window phone it makes a difference.

  • First thing to note is that when I look at your custom event validator, I see no evidence of either of these events. Are you sure you’re sending them?

  • your talking about the “Test & Validate” under the “Integration” tab on the Unity Analytics page right? They work there, however, I do have some events happening that aren’t when someone clicks a link, that aren’t showing up outside of the testing as well.

  • Second, the Dictionary you’re sending is empty. It’s not adding anything helpful and should be removed.

  • I’ve no idea how to just send a string. UnityAnalytics.CustomEvent() needs two arguments, and I went through the abc’s to see what I could do after UnityAnalytics. and UnityAnalytics.SetId was the only thing I found with just a string for an argument. But that doesn’t seem to work out when I test it.

  • What should I use for just a string value and what resource is there to look it up in the future since there is no API yet?

  • Next, try logging the result of the UnityAnalytics.CustomEvent call. CustomEvent returns an Enum, letting you know what the system did with your call. It should return OK if everything worked out.

  • Yep, everything is returning OK.

After trying the dontDestroyOnLoad I’m going to but a brief time inbetween the CustomEvent and loading the URL. I’ll post again when/if either of those work.

That seems very, very unlikely. We already use DontDestroyOnLoad with the SDK to ensure that loading a level doesn’t null out your analytics instance.

Yes. If your events don’t appear under Integration > Validate Custom Events (optional) (when you’re in development), it’s fairly certain that you have a coding problem. Nothing else matters past this point, since it means we never received your event.

My fault, I should have been more specific. You can replace the Dictionary with null, like so:

UnityAnalytics.CustomEvent("MakeUp_Link_1", null);

One other idea, from one of our devs. There’s a small chance that you’ve fallen into a coding sinkhole that requires a manual fix. Debug.Log out your Application.persistentDataPath. Find that directory on your computer and then click into the “Unity” subdirectory. Delete everything in there and try again.

It is showing up in the custom events validation.

Tried that and it did not work. Although the folder in there was as old as the last time the analytic’s updated. Also the folder was a big string of random numbers and letters, now there are two folders, one called Temp and the other is WebPlayer.

I’m going to remove the addon and reinstall it in Unity since there is also an update.

the analytic’s still logs events even if it wasn’t downloaded from the store right? I haven’t installed the game from my Androids memory but a about to start doing that to figure out why this isn’t working, and I’m hoping its not like the ads were it needs to be installed from the store.

I’ve tried creating a new analytics project, reinstalling the old APK in which the analytics did work, using a different device incase it had something to do with the phone I’m using. None of those have work so far.

Also just to clarify, I’m talking about custom events that aren’t preceding opening a url since those also stopped working after the second day along with the other ones, I just hadn’t noticed those since there aren’t as many of them in spots that would trigger them often.

@Cal2 - since SDK 1.9.1, for a build’s event to show up in the dashboard’s validator, the build must be a Development Build. You can set this in the build setting’s “Development Build” checkbox.

Regarding the custom events that weren’t showing, it might have been caused by the issue on our systems on 6/9, its been resolved now and you should see the events.

ok, I solved the problem, kinda. Setting the dictionary to null does not seem to work (at least on androids).

The below code I have triggered on a button press. only “NextButton_Phone two” is showing up when I build and run from my android. However both show up just fine on the Test and Validate page.

            UnityAnalytics.CustomEvent("NextButton_Phone", null);

            UnityAnalytics.CustomEvent("NextButton_Phone two", new Dictionary<string, object>
                                       {
                { "potions", 1 },
               
            });

EDIT ok, the analytics just showed up 48ish hours from when they were sent. so ignore below.

I’m actually a bit confused by this now. If I build with a Development Build, the analytics will show up, but then I can’t upload the game to the google store. If it isn’t a Development Build, the analytics won’t show up. I was thinking that they would work if I downloaded the game from the store, instead of my pc, but that turns out to not be true.