You can install Plotline Library via pub.dev.
Plotline currently supports Android SDK 16 (Android Jelly Bean) and above. The plugin operations are currently no-op for iOS. iOS support will be included in a future release.
1. Install Plotline
javascriptflutter pub add plotline
2. Ensure Android Activity is FlutterFragmentActivity
Open MainActivity.kt in the Android portion of your code:
Change FlutterActivity to FlutterFragmentActivity
kotlinclass MainActivity: FlutterFragmentActivity() { ... }
FlutterActivity and FlutterFragmentActivity have the same functionality. The latter provides access to more Android APIs.
3. Import & initialize Plotline SDK
You can access
<apiKey> via dashboard. Send a unique <userId> .dartimport 'package:plotline/plotline.dart'; Plotline.init(<apiKey>, <userId>);
4. Track Events
Events can be to trigger studies and to filter users for displaying the studies.
You can add this line to your existing analytics wrapper for coverage
dartPlotline.track(<eventName>);
Optionally, you can also pass
properties to the track call:javaPlotline.track(<eventName>, properties: {category: "shopping"});
App size impact
Plotline SDK AAR size is 128KB. Impact on the app bundle is 250KB.
Optional
1. Set Locale
Plotline has the ability to set the locale of a study with the set.Local() function. The following locales are supported:
- en
- hi
- ta
- bn
- mr
- te
- ka
- gu
- pa
dartPlotline.setLocale(<locale>);
2. Identify Users
Plotline allows you to uniquely identify users and add attributes to them for powerful filtering when you are launching your user research studies. Attributes could be custom key value pairs that you set for each user (eg. age, country, subscriptionStatus)
dartPlotline.identify({ "attribute1": "value1", "attribute2": "value2" });
Default Attributes
Plotline automatically tracks the following attributes:
- App Version
- Android Version
- SDK Version
- OS
- Device ID