- 3 Minutes to read
- Print
- DarkLight
Integration and Configuration
- 3 Minutes to read
- Print
- DarkLight
This section describes the installation and initialization of the Flutter Software Development Kit and covers global and advanced configurations.
Installation
Run this command with Flutter.
$ flutter pub add plugin_mappintelligence
This will add a line like this to your package's pubspec.yaml (and run an implicit
dart pub get
):dependencies: plugin_mappintelligence: ^5.x.x
Alternatively, your editor might support
flutter pub get
. Check your editor's documentation to learn more.
Import, now in your Dart code, you can use
import 'package:plugin_mappintelligence/plugin_mappintelligence.dart'; import 'package:plugin_mappintelligence/object_tracking_classes.dart';
And import webview (Just for android if you use webview with the pixel SDK)
import 'package:plugin_mappintelligence/webview_flutter.dart' ;
Initializing the SDK
You need to install the SDK both in Dart and in the Android folder to track iOS and Android applications.
We recommend enabling batch support and switching to client timestamp support in your account when using the SDKs. Please contact your account manager for client timestamp support.
There is no need to initialize the Flutter plugin for Android from native Java or Kotlin code for plugin version 5.0.1 and above.
Before you initialize the SDK, you need to define two critical parameters: Track ID and Track Domain.
Parameter Name | Description |
---|---|
Track ID | An array of tracking IDs, e.g., |
Track Domain | The URL of your tracking server, e.g., |
You can then initialize the SDK in your Dart code, as follows (example for iOS):
void main() {
// Define Track ID and Track Domain
List<String> trackId = ["111111111111111"];
String trackDomain = 'http://tracker-int-01.webtrekk.net';
// Initialize the Plugin with the required Track ID and Track Domain
PluginMappintelligence.initialize(trackId, trackDomain);
// Optional settings to customize tracking behavior
PluginMappintelligence.setEverId("1234567890123456");
PluginMappintelligence.setLogLevel(LogLevel.all);
PluginMappintelligence.setBatchSupportEnabledWithSize(true, 150);
PluginMappintelligence.setRequestInterval(1);
PluginMappintelligence.setSendAppVersionInEveryRequest(true);
PluginMappintelligence.enableCrashTracking(ExceptionType.allExceptionTypes);
// Build the Plugin to apply all settings
PluginMappintelligence.build();
}
The initialize() method requires two arguments: the Track ID and the Track Domain. These arguments are mandatory to start tracking.
Methods (Android and iOS)
Android | iOS | Notes | Default |
---|---|---|---|
Builder(String array, String) | initialize(String array,String) | Initializes tracking. Mandatory to start tracking. | empty |
setEverId | setEverId | Sets custom everID | empty |
logLevel(logLevel: Logger.level) | setLogLevel(LogLevel) | Enables logging. Useful when testing the integration. Should be disabled on production.
| Android: NONE iOS: none |
setBatchSupport(batchEnable: Boolean,requestsInBatch: Int) | setBatchSupportEnabledWithSize(Boolean, requestsInBatch: Int) | Sends requests in batches instead of individually. Recommended to increase data quality. When enabled, the default batch size is 5000 requests/batch. The maximum number is 10000/batch. We recommend to use 150/batch. | false, 5000 |
requestsInterval(timeUnit: TimeUnit = TimeUnit.MINUTES, interval: Long) | setRequestInterval(int) | Specifies the time interval of sending attempts. The minimum time interval in Android is 15 minutes and in iOS 1 minute. The maximum time interval is 60 minutes. | 15 |
setSendAppVersionInEveryRequest | setSendAppVersionInEveryRequest | Sends the app version parameter (cs804) in every request instead of once per session | false |
enableCrashTracking | enableCrashTracking | enables crash tracking. Please note that in Android, only custom crash types can be tracked, and Flutter's function runZonedGuarded() needs to be called. Please check the documentation for iOS and Android: | noneOfExceptionTypes |
disableAutoTracking(Boolean) | We recommend disabling auto-tracking in Flutter. By default, auto-tracking is enabled. | false |
Supported Characters and Coding Formats
Mapp Intelligence supports the UTF-8 standard.
A request may not be larger than 7KB.
Input is case-sensitive.
Parameters can have the data type text or figure.
Text parameters support a maximum of 255 characters. If a parameter is configured to capture multiple values simultaneously, then each single value of the parameter can consist of up to 255 characters. Each of these scalar values is stored in the database as one parameter.
Figure parameters support a range of decimal(12,2). That means ten digits with two decimal places (range: -9999999999.99 to 9999999999.99).
Certain characters are automatically filtered out during tracking:
0x00-0x1f
'
"
<>\
0xA0 => space
Several spaces become one.
Trailing and ending spaces are removed.