Search Unity

Official Setting your Google Play Public Key in Editor vs Dashboard

Discussion in 'Unity IAP' started by John_Corbett, Sep 12, 2022.

  1. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Hello,

    This message is to hopefully clear up any confusion with respect to updating your Google Play App's public key for the Unity In-App Purchasing services.

    Overview


    Since the addition of support for UGS Analytics for In-App Purchasing transaction events, it has been possible to track revenue of your app in your project’s UGS dashboard. Specifically for revenue from Google Play, our services backend can validate receipts using your app’s public key to filter out invalid receipts.

    Since In-App Purchasing has supported the same feature for Legacy Analytics services, there has been some confusion between the two endpoints to activate this feature.

    Each service endpoint has its own place in which you can enter your App’s Google Play Public Key. See the manual page for more information. The purpose of this post is to distinguish the two.

    Setting the Public Key for UGS

    In your project’s In-App Purchasing page on the Unity Dashboard, there is a field in which you can set your App’s Google Play Public Key. Go to your dashboard (via the link in your Project Settings, for example), and you’ll see “In-app purchase (IAP) settings. Enter your public key in the Google License Key field.

    UDashGPPK.png

    Setting the Public Key for the Legacy Settings

    The In-App Purchasing page of the Project Settings in the Editor has an Options section in which you can paste and upload your app’s Google Play Public Key. Pressing Update will send it to the service endpoint.

    EditorGPPK.png

    Note that this service endpoint may not be available for new projects since June 22nd, 2022. We recommend using the UGS endpoint for new projects. At some point, this legacy endpoint may be deprecated.

    NB: After a certain delay, updating this endpoint will show the key in the UI for the UGS dashboard above.

    Concluding remarks

    If your project uses both analytics services, you can enter your key into either fields and track events in either dashboard. Even though this is redundant, the backend responsible for IAP validated transactions indirectly gets its data from both the legacy endpoints (to which the editor Project Settings sendst the key) and the UGS endpoint (where the dashboard sends the key), Whichever endpoint was updated the most recently takes precedence.

    These intermediary endpoints do not share keys, however, the UI for the Unity Dashboard will always display the latest key set, to either endpoint. This is to help support the eventual deprecation of the Legacy endpoint.

    The editor public key view, on the other hand, only shows the changes made directly in-editor and will not show the changes made via dashboard view. Eventually this Editor UI will change in a future update once the legacy endpoint is decommissioned.

    If you do not wish to leverage transaction validation for Google Play on our backend services, you are not required to upload your key into either endpoint.

    Also note that this is not a requirement for revenue tracking overall, but rather for validation of transactions for Google Play revenue. There is no equivalent requirement for validating transactions from other stores.