Search Unity

Feedback Analytics (New) - 4.0.0 Feedback

Discussion in 'Unity Analytics' started by PeachyPixels, Apr 26, 2022.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hello!

    So I updated to 4.0.0-pre.2 this morning and after fixing up the breaking changes, everything appears to be working as expected (at first glance using Charles Proxy)

    A few things to note though...

    1. ConvertCurrencyToMinorUnits

    Firstly, thanks for adding that. I've retired my own conversion extension now.

    It does however take the currency as a double rather than a decimal, which is not best practice for several reasons...

    Currencies are best handled as decimal in C# for rounding reasons. Now in this case the values are largely converted and reported as is, rather than any addition or subtraction, so it should be less of an issue (but still advisable). I suspect it's because internally the conversion uses Math.Pow() which takes a double.

    Unity Purchasing actually correctly uses decimal (for ProductMetadata.localizedPrice) so an extra conversion by the developer is required. Not a huge issue, but addressing the above would also address this.

    Code (CSharp):
    1. AnalyticsService.Instance.ConvertCurrencyToMinorUnits(currency, Decimal.ToDouble(price))
    2. gameBundleID

    This may be an existing issue, but have only just spotted it.

    The analytics events are sending a gameBundleID parameter that does not match the bundle\package id in the settings (only tested in the player)

    For example, my bundle id is...

    com.companyname.productname

    But the bundle id in the analytics events are...

    com.company-name.product-name

    I've raised this before (specifically this was an iOS issue) although this issue may or may not be related...

    https://forum.unity.com/threads/inv...oved-from-the-application-identifier.1254810/

    It looks like in some cases, the persisted project settings bundle id is ignored if the company or product names contain spaces. In this case, a new bundle id is generated that doesn't match.

    I have specifically overridden the bundle id for this very reason (to work around the issue) but even Unity Analytics is ignoring this setting and generating its own (different) id.

    Anyway, hope these helps. I'll continue testing in the coming days (as well as adding support for SetAnalyticsEnabled & TransactionFailed) and post back anything further that is found.
     
    Last edited: Apr 26, 2022
    unity_Ctri likes this.
  2. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    I forgot this...

    CheckForRequiredConsents() makes a call to https://pls.prd.mz.internal.unity3d.com and in the response I see an age gate limit...

    "ageGateLimit": 0

    For my locale it's returning 0 though.

    Is it actually implemented and locale specific? If so, are there any plans to expose it publicly?

    I've just added that exact same field to remote settings for use with the Android Age Gate. So it would be handy if it was supported & working and was locale specific.

    So not an issue, rather a nice to have :)
     
  3. unity_Ctri

    unity_Ctri

    Unity Technologies

    Joined:
    Oct 20, 2020
    Posts:
    83
    Hey PeachyPixels,

    Thanks for the feedback. The second issue is being looked at as a bug, and the first issue has been captured in our feedback system to see if we can make subsequent improvements to the package going forwards.

    Will update you as/when changes occur!
     
    PeachyPixels likes this.
  4. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks @unity_Ctri

    With regards to the bundle id...

    The company & product names (in the project) are both two words (with a space in the middle)

    For some time Unity would generate a bundle id like so (i.e. it would strip non-allowable characters)...

    com.companyname.productname

    And this bundle id would be persisted to the Unity settings file.

    But at some point a change was made that would replace non-allowable characters with hyphens, so the bundle id would look like so...

    com.company-name.product-name

    This would then overwrite the persisted value in the settings file, which is obviously going to cause all sorts of issues with stores etc.

    Ultimately Analytics is using Application.identifier which I believe is where the problem exists. It appears to be ignoring the persisted and\or overridden value. So I don't believe this is an Analytics issue per se.
     
  5. unity_Ctri

    unity_Ctri

    Unity Technologies

    Joined:
    Oct 20, 2020
    Posts:
    83
    Really helpful, thanks!
    I've passed that on to the right people.
     
    PeachyPixels likes this.