--- title: "Functions" slug: "functions" updated: 2026-04-24T10:56:15Z published: 2026-04-24T10:56:15Z canonical: "docs.mapp.com/functions" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Functions ## [Methods](https://pub.dev/documentation/plugin_mappintelligence/latest/plugin_mappintelligence/PluginMappintelligence-class.html) ### Initialize Initializes the SDK. For a complete configuration of the Flutter Intelligence SDK, please check [Configuration](/docs/en/flutter-integration-and-configuration). ```java initialize(List trackIds, String trackDomain) → Future ``` ### Optional setup functions ```java /** * We should use this function to enable batch support * @size is one batch size (The recommended value is between 500 and 5000) */ setBatchSupportEnabledWithSize(bool isEnabled, int size) → Future /** * log level */ setLogLevel(LogLevel logLevel) → Future /** * Request Interval: define how often the library sends a request to the server. The minimum is 15 minutes, which is the default */ setRequestInterval(int intervalSize) → Future /** * Only iOS function: The number of requests in the queue before write the database */ setRequestPerQueue(int requestNumber) → Future ``` JAVA ### Build Builds the SDK. For a complete configuration of the Flutter Intelligence SDK, please check [Configuration](/docs/en/flutter-integration-and-configuration). For Android, please refer to the section *Initializing the SDK for Android*. ```java build() → Future ``` ### Track This function sends data to the Mapp tracking server. To see the complete data configuration of the Mapp Intelligence Java library, please check [Data](/docs/en/flutter-data). It's possible to send actionEvents and pageViewEvents. The following data can only be sent via pageViewEvents: - Page The following data can be sent only via actionEvents: - Action The following information can be sent via both pageViewEvents and actionEvents: - Campaign - Customer - Product - Order - Goal - Session The following information can be sent in MediaEvents: - Media - Action - E-commerce - Session ```java /** * @Action(Event) tracking function * @return void */ trackAction(ActionEvent actionEvent) → Future /** * @Media tracking function * @return void */ trackMedia(MediaEvent mediaEvent) → Future /** * @Page(Screen) trakcing function * @return void */ trackPage(String customName, [Map? trackingParameters]) → Future /** * @ * @Page(Screen) trakcing function with custom data and PageViewEvent * @return void */ trackPageWithCustomData(PageViewEvent? pageViewEvent, [String? customName]) → Future ``` ### Deep link Deep Link tracking allows you to analyze campaigns that are deep-linked to a screen of your mobile app. ```javascript /** * @param url specifies the URL to be tracked. Please note that you need to use the campaign format used by Mapp Intelligence. * @return void */ trackUrl(String urlString, String? mediaCode) → Future ``` ```javascript /** * Campaign that uses "wt_mc" as media code. */ buttons.add(ElevatedButton(      onPressed: () async {        var urlString =            "https://testurl.com/?wt_mc=email.newsletter.nov2020.thursday&wt_cc45=parameter45";        PluginMappintelligence.trackUrl(urlString, null);        String className = this.runtimeType.toString();        PluginMappintelligence.trackPageWithCustomData(null, className);      },      child: Text('Test Link1'),      style:          ElevatedButton.styleFrom(primary: Theme.of(context).primaryColorDark),    )); /** * Campaign that uses a custom media code. */    buttons.add(ElevatedButton(      onPressed: () async {        var urlString =            "https://testurl.com/?customMc=email.newsletter.nov2020.thursday&wt_cc12=parameter12";        PluginMappintelligence.trackUrl(urlString, "customMc");        String className = this.runtimeType.toString();        PluginMappintelligence.trackPageWithCustomData(null, className);      }, ``` ### Anonymous Tracking With anonymous tracking, it’s possible to track usage of the mobile application without persistently tracking a user across sessions. When anonymous tracking is enabled, the default user identifier is not set. To provide better data quality during session tracking, a temporary session ID can be set. The temporary session ID identifies requests from the same session. ```javascript /** * Anonymous tracking can be called on initialization or during runtime. */ // Enable anonymous tracking. If needed, include a String of additional parameters to be excluded from tracking if anonymous tracking is enabled.   setAnonymousTracking(bool enabled, List ) -> Future // Set a temporary session ID. setTemporarySessionId() -> Future ``` ### User Matching User Matching allows you to use Intelligence analytics data to better target users via mobile push or in-app messages in Engage. ```javascript /** * User matching only works if anonymous tracking is inactive. It is possible to set user matching on initialisation as well as on runtime. */ setUserMatchingEnabled(bool enabled) → Future ``` ### Opt-out ```java /** * set to true if you want to send the currently cached data before setting the opt-out. Default is false. */ optOutAndSendCurrentData(bool value) → Future ``` ### Opt-in ```java /** * @return void */ optIn() → Future ``` ### Get EverID ```java /** * @return everID */ getEverID() → Future ``` ### Change TrackID and Track Domain on Runtime It is possible to change the track ID and track domain on runtime. ```java /** * @return everID */ PluginMappintelligence.setIdsAndDomain([array String account ID], String track domain); ``` ### WebView Follow these steps to enable Mapp Intelligence tracking inside WebView. 1. Add a WebView to your app by adding webview_flutter to your pubspec.yaml and importing it: ```dart import 'package:webview_flutter/webview_flutter.dart'; ``` 2. Create and configure your controller in initState() to initialize the WebView controller. ```dart final _controller = WebViewController()   ..setJavaScriptMode(JavaScriptMode.unrestricted); ``` 3. Initialize WebTrackingController by passing your WebView controller to WebTrackingController to enable tracking: ```dart WebTrackingController(controller: _controller); ``` 4. Load your tracked web page: ```dart _controller.loadRequest(   Uri.parse('https://demoshop.webtrekk.com/media/web2app/index.html'), ); ``` 5. To display the WebView, use the WebViewWidget, and pass in your controller: ```dart WebViewWidget(controller: _controller); ``` #### Full Example ```dart class WebviewScreen extends StatefulWidget {  @override  WebviewScreenState createState() => WebviewScreenState(); } class _WebviewScreenState extends State {  late final WebViewController _controller;  @override  void initState() {    super.initState();    _controller = WebViewController()      ..setJavaScriptMode(JavaScriptMode.unrestricted);    WebTrackingController(controller: _controller);    _controller.loadRequest(      Uri.parse('https://demoshop.webtrekk.com/media/web2app/index.html'),    );  }  @override  Widget build(BuildContext context) {    return WebViewWidget(controller: _controller);  } } ``` ### Send Request Immediately (Android only) Due to the use of WorkManager, Android is limited in terms of the scheduled sending of requests. As long as the app is used in the foreground, it is possible to trigger the sending of requests on any event trigger. ```java PluginMappintelligence.sendAndCleanData() ``` ### Print Current Configuration While testing and debugging the configuration, it can be helpful to print out the currently active global configuration to the console. ```java PluginMappintelligence.getCurrentConfig() ``` ### Reset Singleton It's helpful to be able to reset the Intelligence singleton for testing purposes. Resetting the singleton will reset the SDK configuration to its default values. ```java PluginMappintelligence.reset() ```