Search Unity

IAP analytics and server-side receipt validation

Discussion in 'Unity Analytics' started by PNordlund, Jun 11, 2018.

  1. PNordlund

    PNordlund

    Joined:
    Nov 20, 2013
    Posts:
    48
    We are using Unity In-App Purchasing and it's enabled in the project. We are doing receipt validation on the server so we haven't entered Google Public Key in the IAP settings in the Unity editor.

    When I go the analytics dashboard and hit "IAP Purchase Report" I get a dialog "Let's enable Unity IAP (In-App Purchasing) for your project" and can't go no further. What I'm doing wrong?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You may have one user who inadvertently disabled IAP/Analytics (or didn't have access permission). On your system, go into the Unity Editor and temporarily disable IAP and Save and exit Unity. Reopen Unity, and enable IAP again. This should toggle this setting in the Dashboard.
     
  3. PNordlund

    PNordlund

    Joined:
    Nov 20, 2013
    Posts:
    48
    Thanks, it worked!
     
  4. MatthieuPr

    MatthieuPr

    Joined:
    May 4, 2017
    Posts:
    56
    Hey JeffD,

    We got the analytics dashboard to work, but all we see is 0 as revenue. We do know we have several successful purchases, but they are not marked as valid within Unity Analytics.

    We do server side validation: get the receipt, mark the purchase as pending, send to our validation server and when receive reply from it we confirm the pending purchase.

    Is there a way to tell Unity IAP that some purchase is valid or not when confirming pending purchase?

    Thanks
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you initiate the test purchases yourself? May I ask how you are confirming (outside of receipt validation) that the purchases are valid? There is not a 100% way to assure the purchases are valid.
     
  6. MatthieuPr

    MatthieuPr

    Joined:
    May 4, 2017
    Posts:
    56
    Those aren't test purchases, those are live users making purchases.

    The user makes a purchase using UnityIAP, once we receive receipt, we mark the purchase as pending and we send the receipt to our server, using a google server account we send the receipt from the server through the google API for validation. After which we receive a response, give the user his items and inform our client that purchase was completed and how (success, canceled, failed). After which we mark purchase as completed from within the client and give feedback on what he purchased.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446