Tech 3 min read

Tracking In-App Purchase Revenue with Flutter and Adjust

Previous articles in this series:


I got purchases working in Flutter and receipt validation succeeded, but the revenue numbers weren’t showing up in the Adjust dashboard. The issue turned out to be that Adjust has no way to know the purchase amount unless the app sends it explicitly — it’s not an Adjust configuration problem.

Sending Revenue Data to Adjust

Attach the amount to your Adjust event by calling setRevenue.

import 'package:adjust_sdk/adjust.dart';
import 'package:adjust_sdk/adjust_event.dart';

void trackPurchase(String eventToken, double price, String currency) {
  AdjustEvent event = AdjustEvent(eventToken);
  event.setRevenue(price, currency);  // This is required

  // Optional: deduplicate with transaction ID
  event.setTransactionId(transactionId);

  Adjust.trackEvent(event);
}

Key Points

  • Without calling setRevenue(amount, currency), Adjust has no way to know the amount
  • There’s no automatic retrieval from Google Play or the App Store (even with store integration, per-event revenue must be sent manually)
  • The “Revenue” column in the Adjust dashboard only reflects values you send this way
  • There’s no field to set a revenue amount in the Adjust dashboard’s event settings — the design relies entirely on sending it from the SDK

Call setRevenue with the purchase price at the point where receipt validation succeeds, and the numbers will start showing up.

Switching from Sandbox to Production

The switch from Adjust’s sandbox to production environment is done by changing the config at SDK initialization time.

import 'package:adjust_sdk/adjust.dart';
import 'package:adjust_sdk/adjust_config.dart';

AdjustConfig config = AdjustConfig(
  'YOUR_APP_TOKEN',
  AdjustEnvironment.production,  // Change sandbox → production
);

// If you had verbose logging in sandbox, turn it off
// config.logLevel = AdjustLogLevel.verbose;  // Remove or suppress in production

Adjust.initSdk(config);

Things to Keep in Mind When Switching

  • Just changing to AdjustEnvironment.production is enough — data flows to the production dashboard
  • App token and event tokens are the same (they don’t differ between sandbox and production)
  • Uncheck the “Sandbox” filter in the Adjust dashboard to see production data
  • Even with Google Play internal testing or closed testing, data is recorded as production data if you use the production environment
  • No “go-live” action is required on the Adjust dashboard side

The standard practice is to switch AdjustEnvironment to production when releasing to the store. Using a build flag to switch environments is a clean approach.