Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Underscores added to event names breaking our analytics tracking

Discussion in 'Unity Analytics' started by johnluxford, Jun 12, 2023.

  1. johnluxford

    johnluxford

    Joined:
    Oct 14, 2015
    Posts:
    24
    We pushed an update and noticed that suddenly all our custom events that we've already defined in UGS Analytics started getting the double underscores added to them and failing to import. I still see the custom events defined in UGS Analytics that should match what we're sending, but since the double underscores are getting added somewhere we're losing all our custom event data. What can we do to get it to stop adding double underscores?

    We've defined events and their parameters and everything was working well for a while, and we haven't changed anything on our end so I can't see why it would have changed or what we can do on our end to get it working again.

    We haven't updated Unity recently and we're pinned to 2020.3.36f1 at the moment. Analytics package is at 4.0.1.

    Thanks!
     
  2. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    43
    Hey @johnluxford,

    Could you provide your organization ID and project name? Also, are you using Legacy Analytics too?

    Thanks,
    Clare
     
  3. johnluxford

    johnluxford

    Joined:
    Oct 14, 2015
    Posts:
    24
    I believe we've updated everything to use the new analytics. I do see both com.unity.analytics and com.unity.modules.unityanalytics in our manifest.json, but I checked our code and it only refers to the new analytics API.

    Our project ID is e377fb33-0fa3-4fae-8257-9d176359d2ab and name is "Flipside", however I don't see where to find our organization ID.
     
  4. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    43
    Hey @johnluxford, I think i've found it. Just to confirm the organization name is The Campfire Union Inc. right?
    The events that are failing to import are the ones that are automatically being sent from Legacy Analytics - is this something you want to keep? If not, this can be disabled by disabling Legacy Analytics in the Editor via the toggle and no new data will be forwarded to UGS Analytics.

    Otherwise, if you would like to keep those events coming through I can ask someone to take a look at the issue with the underscore that you're encountering.
     
  5. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    43
    Hi again, i've checked in with the team and it appears that the banner being shown on your account is outdated and the issue with the extra underscores has been corrected at the start of the year. Apologies for the confusion, we're working to refresh these banners.
    We can see under invalid events in the Event Browser that there are a couple of schema issues such as unexpected keys being sent or that a parameter is being sent with the wrong type.
     
  6. johnluxford

    johnluxford

    Joined:
    Oct 14, 2015
    Posts:
    24
    The Campfire Union Inc. is the correct organization name.

    It took me a while to find the legacy analytics toggle but just found it. I'll turn that off because I'm pretty sure we're not using legacy any more. I also cleared some outdated warnings and was able to fix a couple other events that were missing a parameter.

    One of the last one's I'm seeing fail is a parameter that's the wrong type. The event name is "select_avatar" and the parameter in question is "avatar". What's weird is we're setting that parameter like this:

    parameters["avatar"] = avatarId.ToString()

    The error is that the value received looks like an int and the parameter type expects a string, but as you can see we should be sending a string already. And it looks like most of the time it's being received as a string.

    A clue might be that the failed "select_avatar" event contents look quite different than the valid ones for the same event, but it doesn't look like anything we can change on our end.

    Comparing that to the last failed events, which failed with a "Event timestamp outside valid boundaries - eventTimestamp" error, these also look quite different than the ones that passed. And most do seem to be passing. Since the event contents that differ don't seem like they're under our control, that may be a bug in the system, I'm not sure.

    Anyway, thanks for the help and I hope the above is useful in figuring out if there are any edge cases where things might fail. Cheers!
     
    clarec_unity likes this.
  7. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    43
    Great, glad to hear you've managed to get a few sorted. Seems like the avatar parameters are being accepted now too.

    Regarding the "Event timestamp outside valid boundaries - eventTimestamp" error, i've just checked the most recent event that failed and the timestamp is "eventTimestamp": "2023-03-20 14:17:49 +00:00". We only accept events that are either 31 days in the past or a day in the future.

    Please do let us know if there is anything else we can help with :)
     
  8. johnluxford

    johnluxford

    Joined:
    Oct 14, 2015
    Posts:
    24
    I think we're all good from here.

    That said, since some of the events that failed with the timestamp error were ones sent automatically by the library itself, that makes me think there might be a bug somewhere if it's able to create timestamps that are outside of those bounds.