Configure automatic in-app purchase tracking

GetSocial SDK supports tracking purchases users make in your application. The gathered data is shown in Revenue Analytics section.

To be able to track purchases, SDK requires some configuration steps.

Android

To track in-app purchases automatically on Android, GetSocial can get data from the Google Play Billing Library or Google Play Billing Service depending on what you are using for in-app purchases.

You have to configure only one approach. Therefore it is crucial to determine what are you using.

Determine what to configure

To help you to determine which approach you are using and have to configure:

  1. Enable GetSocial debug logs and start your application.
  2. Open Logcat → set filtering level to DEBUG.
  3. Search your logs. They will contain one of the following lines:

Option A: Configure Google Play Billing Library

  1. Login to Google Play Developer Console.
  2. Choose the application you registered on GetSocial Dashboard.
  3. Open Development toolsServices & APIs.
  4. Copy the Base64-encoded RSA public key in Licensing & in-app billing.
  5. Open GetSocial Dashboard and go to App SettingsIAP Tracking.
  6. Enable Google Play, choose Using Google Play Billing Library option and paste the copied license key into the input field.
  7. Press Save to persist your changes.

Option B: Configure Google Play Billing Service

  1. Go to the Google Play Developer Console.
  2. Select SettingsAPI access.
  3. Click the Create New Project button.
  4. Click the Create Service Account button in the Service Accounts section.
    SDK Security settings on the Dashboard

  5. In the info box click on the Google API Console link.
    SDK Security settings on the Dashboard

  6. Now click on Create Service Account button.
    SDK Security settings on the Dashboard

  7. Enter Service account details then click on Create button.
    SDK Security settings on the Dashboard

  8. On Service account permissions (optional) page add Android Management User role from Android Management group, then click on Next button.
    SDK Security settings on the Dashboard

  9. On Grant users access to this service account (optional) page click on Create key button.
    SDK Security settings on the Dashboard

  10. Select JSON format and press Create. This will trigger the private key to be downloaded to your computer.
    SDK Security settings on the Dashboard

  11. Close it using the Close button.
    SDK Security settings on the Dashboard

  12. To finish API access configuration, go back to API access page and click on Grant access next to the service account email.
    SDK Security settings on the Dashboard

  13. Choose a role, like View financial reports and click on Add user button.
    SDK Security settings on the Dashboard

  14. Open GetSocial Dashboard and go to App SettingsIAP Tracking.

  15. Enable Google Play, choose Using Google Play Billing Service option and upload the downloaded JSON file.
  16. Press Save to persist your changes.
  17. Take in mind that it could take up to 48 hours for Google Account permissions to propagate.

Testing

Launch your application and make a purchase (test purchase is also fine). On Android, purchases are tracked on each application launch, so after you finished the purchase process, you need to stop and restart your application.

Revenue analytics will start appearing in the GetSocial Dashboard in the Revenue analytics section. Take in mind that it could take up to 1 hour for the analytics to get updated.

iOS

Configuration

Purchase tracking on iOS requires your App-Specific Shared Secret code.

  1. Login to iTunes Connect.
  2. Select My Apps.
  3. Choose the application you registered on GetSocial Dashboard.
  4. Select Features tab.
  5. Choose on In-app Purchases on the left side.
  6. Click on App-Specific Shared Secret on the right side.
  7. Copy the Shared secret code.
  8. Open GetSocial Dashboard and go to App SettingsIAP Tracking
  9. Enable Apple App Store and paste the copied shared secret into the input field.
  10. Press Save to persist your changes.

Testing

Launch your application and make a purchase (test purchase is also fine). After you finished the purchase process, go to GetSocial Dashboard, you should see your new purchase in Revenue analytics section.

Give us your feedback! Was this article helpful?

😀 🙁