Skip to main content

Android App Integration

Connect your Android app with Monetai to track revenue from Google Play Store in real-time.

Integration Methods

Android app integration can be set up using the following two methods:

Method 1: Dashboard Onboarding Section

Method 2: Settings Menu

Integration Process

Android app integration consists of 3 steps, with detailed procedures for each step.

Step 1: App Package Integration

1-1. Enter Package Name

Retrieve the package name from Google Play Console and enter it.

Setup Method:

  1. Log in to Google Play Console
  2. Select the app to connect with Monetai
  3. Copy the package name of the app (e.g., com.example.app)
  4. Enter it in the Monetai dashboard

Android Package Name Input

Step 2: Google Service Account Creation and Key Issuance

Create a service account for Google Play Store API access and configure permissions.

2-1. Enable Google Developer API

Setup Method:

  1. Select a project or create a new project in Google Play Console
  2. Search for Google Play Android Developer API
  3. Click the [Enable] button

Enable Google Developer API

2-2. Create Service Account

Setup Method:

  1. Navigate to [IAM & Admin] > [Service Accounts] in Google Cloud Console
  2. Click [Create Service Account] Create Service Account
  3. Enter service account name and click [Create and Continue]
  4. In the [Grant this service account access to project] step, add the [Pub/Sub Admin] role Service Account Permission Check

2-3. Download Service Account Key

Setup Method:

  1. Click the action button (⋮) of the created service account
  2. Select [Manage Keys] Download Service Account Key
  3. Click [Add Key] > [Create New Key]
  4. Select key type as JSON and create and download

2-4. Grant Google Play Console Permissions

Setup Method:

  1. Navigate to [Users and Permissions] menu in Google Play Console
  2. Enter the service account email address that was created
  3. Under [Permissions], set the following 3 permissions in [Account Permissions]:
    • View app information and download bulk reports (read-only)
    • View financial data, orders, subscription cancellation survey responses
    • Manage orders and subscriptions
  4. Click [Invite User] Grant Google Play Console Permissions

2-5. Register Service Account JSON

Setup Method:

  1. Copy the content of the Service Account JSON file downloaded in step 2-3
  2. Paste it into the Monetai Dashboard
  3. Click the [Verify Permissions] button to confirm all permissions are set correctly

Step 3: Real-time Developer Notifications Setup

Configure Google's Real-Time Developer Notifications (RTDN) to receive real-time purchase information.

3-1. Enable Pub/Sub API

Setup Method:

  1. Go to Google Cloud Console
  2. Verify that the same project where the service account was created is selected in the project selection menu at the top
  3. If Pub/Sub API is disabled, click the [Enable] button Enable Pub/Sub API

3-2. Select and Connect Pub/Sub Topic

Setup Method:

  1. Go to Monetai Dashboard
  2. If you have an existing topic receiving Google real-time developer notifications, select that topic
  3. If not, click [Create New Topic] to create a new topic
  4. After selecting the topic, click the [Connect] button

💡 Using Third-party Services (Adapty, etc.)

If you're using third-party services like Adapty and cannot find your existing Pub/Sub topic, you can connect via URL instead of Pub/Sub topic.

For Adapty users:

  1. Go to your Adapty dashboard
  2. Navigate to App Settings > Google Play RTDN topic name
  3. Find the "URL for forwarding raw Google events" field
  4. Enter the webhook URL provided by Monetai in this field

For more details, refer to Adapty's RTDN documentation.

3-3. Register Topic in Google Play Console

💡 Note for URL Integration Users

If you're connecting via URL (as described in step 3-2), you can skip this step 3-3.

Setup Method:

  1. Navigate to the dashboard of the app to connect with Monetai in Google Play Console
  2. Select [Monetization] > [Monetization Settings] from the sidebar
  3. Copy the Topic ID provided by Monetai and paste it into the [Topic name] field under [Real-time developer notifications]
  4. Select [Notification content] as "Subscriptions, voided purchases, and all one-time products" and save

Register Topic in Google Play Console

3-4. Verify Test Notification

Setup Method:

  1. Click the [Send Test Notification] button below the [Topic name] field
  2. Click the [Refresh] button in Monetai Dashboard to confirm notification reception
  3. When "Reception Complete" message appears, integration is complete

Send Test Notification

Supported Notification Types

Monetai tracks the following events in real-time through Real-Time Developer Notifications:

  • Subscription free trial start
  • Paid subscription start
  • Paid subscription renewal
  • Refunds

Integration Verification

Once integration is complete, you can verify it using the following methods:

  • Test Notification: Send test notification from Google Play Console and confirm reception

Troubleshooting

Frequently Occurring Issues

Q: Cannot find package name A: You can check the package name in the app information after selecting the app in Google Play Console.

Q: Service account permission verification fails A: Please check the following:

  • Whether Google Play Android Developer API is enabled
  • Whether Pub/Sub Admin role is granted to the service account
  • Whether correct permissions are granted to the service account in Google Play Console

Q: Test notification is not received A: Please check the following:

  • Whether Pub/Sub API is enabled
  • Whether the topic is connected correctly
  • Whether the topic is registered in Google Play Console

Support

If you encounter any issues during the integration process, please contact support@monetai.io.

Next Steps

Once Android app integration is complete, proceed to the next steps: