Amplitude's Guides and Surveys Flutter SDK lets you deploy Guides and Surveys in your Flutter applications.
The Guides and Surveys Flutter SDK requires:
Add the Guides and Surveys package and the Amplitude Analytics SDK to your pubspec.yaml:
dependencies:
amplitude_flutter: ^4.4.0
amplitude_engagement_flutter: ^0.0.5
Run flutter pub get to install the dependencies.
Run pod install in the ios directory.
cd ios
pod install
import 'package:app_links/app_links.dart';
import 'package:amplitude_flutter/amplitude.dart';
import 'package:amplitude_flutter/configuration.dart';
import 'package:amplitude_engagement_flutter/amplitude_engagement.dart' as engagement;
// Initialize Analytics
final amplitude = Amplitude(Configuration(apiKey: 'YOUR_API_KEY'));
// Connect the engagement SDK to the analytics instance
await engagement.installAmplitudeEngagementPlugin(amplitude);
// Handle deep links for preview mode
final appLinks = AppLinks();
appLinks.getInitialLink().then((uri) async {
if (uri != null) {
final didHandleURL = await engagement.handleURL(uri.toString());
if (didHandleURL) { return; }
// Handle a non-Amplitude SDK URL
}
});
appLinks.uriLinkStream.listen((uri) async {
final didHandleURL = await engagement.handleURL(uri.toString());
if (didHandleURL) { return; }
// Handle a non-Amplitude SDK URL
});
installAmplitudeEngagementPlugin initializes the engagement SDK using the same API key and passes the native analytics instance to the engagement layer on iOS and Android.
Pass an AmplitudeInitOptions object to installAmplitudeEngagementPlugin to configure the SDK:
await engagement.installAmplitudeEngagementPlugin(amplitude, options: AmplitudeInitOptions(
serverZone: AmplitudeServerZone.eu,
logLevel: AmplitudeLogLevel.debug,
));
| Parameter | Type | Description |
|---|---|---|
serverZone |
EU or US |
Optional. Sets the Amplitude server zone. Set this to EU for Amplitude projects created in the EU data center. Default: US |
serverUrl |
string |
Optional. Custom server URL for API requests. Useful for proxy setups. |
cdnUrl |
string |
Optional. Custom CDN URL for static assets. Useful for proxy setups. |
mediaUrl |
string |
Optional. Custom URL for proxying nudge images. Useful for proxy setups when firewalls block images. |
logLevel |
LogLevel enum |
Optional. Sets the log level. Default: LogLevel.warn |
locale |
string |
Optional. Sets the locale for localization. Not setting a language means the SDK uses the default language. |
Make sure the API key you provide to Guides & Surveys matches the API key used to initialize your Amplitude Analytics SDK.
Boot the SDK with a user ID to enable Guides and Surveys:
import 'package:amplitude_flutter/amplitude.dart';
import 'package:amplitude_flutter/events/identify.dart';
import 'package:amplitude_engagement_flutter/amplitude_engagement.dart' as engagement;
// Setting the User ID in Amplitude Analytics
// --and-- passing it to boot() is necessary
amplitude.setUserId('test-user-1');
// boot(userId, deviceId, userProperties)
await engagement.boot(
userId: 'test-user-1',
deviceId: 'test-device-1', // optional if userId is set
userProperties: {'plan': 'premium'}, // optional
);
After installing the SDK, add your Flutter application to your Amplitude project settings so it appears as a platform option when you create guides and surveys.
To add your application:
After you add your application, it appears as a platform option when you create or edit guides and surveys. This enables you to deliver guides and surveys to your Flutter app users.
Minimum SDK version is available for mobile SDK versions 3.0.0 and later. Use this setting as a safety control when you identify a critical issue in an older SDK release.
To configure a minimum SDK version:
When you set this value, Guides and Surveys compares the configured minimum with the SDK version in each app build:
This setting lets you stop guides and surveys on known problematic SDK versions without rolling back your application release.
Call screen to enable screen-based targeting and the Time on Screen trigger. Guides and Surveys compares the screen string (for example, "HomeScreen") with the string you set in the guide or survey page targeting section.
engagement.screen('HomeScreen');
Pin and tooltip guides require the SDK to target specific widgets on screen. The SDK automatically enables element targeting on initialization.
Tag targetable widgets with AmplitudeEngagementView as a SemanticsTag to give them a stable identifier. In the example below, use "welcome-banner" as the element targeting string in the Guides and Surveys dashboard.
import 'package:flutter/material.dart';
import 'package:amplitude_engagement_flutter/amplitude_engagement.dart' as engagement;
Semantics(
tagForChildren: const engagement.AmplitudeEngagementView('welcome-banner'),
child: Banner(
child: Text('Welcome to the app'),
),
)
Previewing guides and surveys directly in your application lets you experience what your users see. Previewing makes it easier to iterate on copy, targeting rules, and trigger logic.
To locate the URL scheme:
amp-abcdefgh12345678.AmplitudeURLScheme for example.amp-abc123.To locate the URL scheme:
amp-abcdefgh12345678.Add the following intent filter to the main activity in your project's AndroidManifest.xml file:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Add your URL scheme from Amplitude Dashboard here -->
<!-- ex: android:scheme="amp-12345" -->
<data android:scheme="<your-unique-scheme-id>" />
</intent-filter>
</activity>
The initialization code snippet already takes care of URL handling for preview links. Specifically, this code:
final appLinks = AppLinks();
appLinks.getInitialLink().then((uri) async {
if (uri != null) {
final didHandleURL = await engagement.handleURL(uri.toString());
if (didHandleURL) { return; }
// Handle a non-Amplitude SDK URL
}
});
appLinks.uriLinkStream.listen((uri) async {
final didHandleURL = await engagement.handleURL(uri.toString());
if (didHandleURL) { return; }
// Handle a non-Amplitude SDK URL
});
engagement.setThemeMode(AmplitudeThemeMode.dark); // Options: auto, light, dark
engagement.addCallback('show-alert', () {
// Custom logic when the guide or survey triggers this callback
});
engagement.reset('GUIDE_KEY', 0);
final guidesAndSurveys = await engagement.list();
engagement.show('GUIDE_KEY');
Use forwardEvent to enable the On event tracked trigger in Guides and Surveys. The SDK doesn't send forwarded events to Amplitude servers; it uses them only for local trigger evaluation.
engagement.forwardEvent({
'event_type': 'Button Clicked',
'event_properties': {'name': 'Submit'},
});
engagement.closeAll();
Pins and tooltips can't target widgets that are:
You can access the changelog here.
April 3rd, 2026
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2026 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.