Adopture Docs
SDKsFlutter

Tracking Events

Track custom events and screen views with the Adopture Flutter SDK.

The Adopture SDK lets you track custom events and screen views with a simple API. Events are queued locally and sent to the server in batches.

Custom Events

Track any action in your app with Adopture.track():

// Simple event
Adopture.track('button_clicked');

// Event with properties
Adopture.track('item_added', {
  'item_id': 'sku_123',
  'category': 'electronics',
  'price': '29.99',
});

Screen Views

Track when users navigate to a screen with Adopture.screen():

Adopture.screen('product_detail');

Adopture.screen('search_results', {
  'query': 'wireless headphones',
  'results_count': '42',
});

For automatic screen view tracking with Navigator or GoRouter, see Navigation Tracking.

Event Properties

Properties are string key-value pairs that provide additional context for your events.

  • Maximum 50 properties per event
  • Property values can be up to 500 characters long
  • Both keys and values must be strings

Sending Events

Events are queued locally and sent in batches based on your configuration:

  • Every 30 seconds (default flushInterval)
  • When 20 events are queued (default flushAt)
  • When the app goes to background

To send queued events immediately:

await Adopture.flush();

In debug mode, events are sent immediately without batching.

On this page