Skip to main content

Flutter SDK

Welcome to the official Moveo One Flutter library.

Moveo One Analytics is a user cognitive-behavioral analytics tool that provides deep insights into user behavior and interaction patterns. The moveo-analytics-flutter SDK enables Flutter applications to leverage Moveo One's advanced analytics capabilities.

Key Features

  • Semantic grouping of user actions
  • Component-level analytics
  • Non-intrusive integration
  • Privacy-focused design
  • Automatic data batching and transmission

Prerequisites

  • Flutter SDK (2.0.0 or higher)
  • Dart SDK (2.12.0 or higher)
  • A Moveo One API key

Installation

Add the Moveo One Analytics Flutter SDK to your pubspec.yaml:

dependencies:
moveoone_flutter: ^0.0.14

Then, install the dependency:

flutter pub get

Library Initialization

Initialize MoveoOne early in your application lifecycle, typically in the main.dart file.

import 'package:moveoone_flutter/moveo_one.dart';

void main() {
// Initialize with your API key
MoveoOne().initialize("your_api_key");

runApp(const MyApp());
}

Setup

Start a tracking session before tracking any events. This should be called before any track() or tick() calls.

// Start tracking session with context
MoveoOne().start("your_context_eg_onboarding-app-settings");

// Or with metadata
MoveoOne().start(
"checkout_flow",
metadata: {
"app_version": "1.0.0",
"platform": "mobile",
}
);

Metadata and Additional Metadata

updateSessionMetadata()

Updates current session metadata. Session metadata should split sessions by information that influences content or creates visually different variations of the same application. Sessions split by these parameters will be analyzed separately by our UX analyzer.

MoveoOne().updateSessionMetadata({
"test": "a",
"locale": "eng",
});

When to Call This Method:

  • When important information about the user or session changes during the app's lifecycle
  • Don't call before session starts
  • Use for parameters that create different visual or content variations
  • Session metadata examples:
    • "test": "a"
    • "locale": "eng"
    • "app_version": "2.1.0"

updateAdditionalMetadata()

Updates additional metadata for the session. This is used as data enrichment and enables specific queries or analysis by the defined split.

MoveoOne().updateAdditionalMetadata({
"user_country": "US",
"company": "example_company",
"user_role": "admin", // or "user", "manager", "viewer"
"acquisition_channel": "organic", // or "paid", "referral", "direct"
"device_category": "mobile", // or "desktop", "tablet"
"subscription_plan": "pro", // or "basic", "enterprise"
"has_purchased": "true", // or "false"
});

When to Call This Method:

  • For secondary or experimental data
  • When you want to track data separately from main session metadata
  • Don't call before session starts
  • Use for data enrichment and specific analysis queries
  • Additional metadata examples:
    • "app_version": "2.1.0"
    • "user_country": "US"
    • "company": "example_company"
    • "user_role": "admin" // or "user", "manager", "viewer"
    • "acquisition_channel": "organic" // or "paid", "referral", "direct"
    • "device_category": "mobile" // or "desktop", "tablet"
    • "subscription_plan": "pro" // or "basic", "enterprise"
    • "has_purchased": "true" // or "false"

Track Data

track() Method

Tracks events with explicit context specification.

MoveoOne().track(
"home_screen", // Context
MoveoOneData(
semanticGroup: "navigation",
id: "btn_submit",
type: MoveoOneType.button,
action: MoveoOneAction.tap,
value: "Submit button clicked",
),
);

When to Use track():

  • When you want to explicitly specify the event context
  • When you need to change context between events
  • When you want to use a different context than the one specified in start()

tick() Method

Tracks events using the context from the start() method.

MoveoOne().tick(
MoveoOneData(
semanticGroup: "user_interactions",
id: "main_button",
type: MoveoOneType.button,
action: MoveoOneAction.appear,
value: "primary_action",
),
);

When to Use tick():

  • When tracking events within the same context
  • When you want tracking without explicitly defining context
  • When you want to track events in the same context specified in start()

Understanding Context and Semantic Groups

Context:

  • Represents large, independent parts of the application
  • Serves to divide the app into functional units that can exist independently
  • Examples: onboarding, main_app_flow, checkout_process

Semantic Groups:

  • Logical units within a context that group related elements
  • Could be a group of elements or an entire screen (most common)
  • Examples: navigation, user_input, content_interaction

Method Call Order

  1. initialize() - Set up the library with API key
  2. start() - Begin tracking session (required before any tracking)
  3. updateSessionMetadata() / updateAdditionalMetadata() - Set metadata (optional)
  4. track() / tick() - Track user interactions
  5. updateSessionMetadata() / updateAdditionalMetadata() - Update metadata as needed

Event Types and Actions

Event Types (MoveoOneType)

TypeDescriptionUse Case
buttonClickable buttons, action triggersSubmit buttons, navigation buttons
textText labels, descriptionsHeaders, labels, descriptions
textEditInput fieldsText inputs, search bars
imageImage componentsProduct images, avatars
imagesMultiple imagesImage galleries
imageScrollHorizontalHorizontal image scrollingImage carousels
imageScrollVerticalVertical image scrollingImage lists
pickerSelection componentsDate pickers, dropdowns
sliderSlider controlsVolume controls, range selectors
switchControlToggle switchesSettings toggles
progressBarProgress indicatorsLoading bars, upload progress
checkboxCheckbox controlsMulti-select options
radioButtonRadio button controlsSingle-select options
tableTabular dataData tables, lists
collectionCollection viewsGrid layouts, lists
segmentedControlSegmented controlsTab bars, segmented buttons
stepperStep indicatorsMulti-step forms
datePickerDate selectionCalendar pickers
timePickerTime selectionClock pickers
searchBarSearch functionalitySearch inputs
webViewWeb contentEmbedded web pages
scrollViewScrollable contentScrollable lists, pages
activityIndicatorLoading indicatorsSpinners, loading states
videoVideo contentVideo players
videoPlayerVideo player controlsPlay, pause, seek controls
audioPlayerAudio player controlsMusic players
mapMap componentsLocation maps
tabBarTab navigationBottom tabs, top tabs
tabBarPageTab page contentIndividual tab content
tabBarPageTitleTab page titlesTab headers
tabBarPageSubtitleTab page subtitlesTab subheaders
toolbarToolbar componentsAction bars
alertAlert dialogsPopup alerts
alertTitleAlert titlesAlert headers
alertSubtitleAlert subtitlesAlert descriptions
modalModal dialogsPopup modals
toastToast notificationsBrief notifications
badgeBadge indicatorsNotification badges
dropdownDropdown menusSelection menus
cardCard componentsContent cards
chipChip componentsTags, filters
gridGrid layoutsGrid views
customCustom componentsAny other UI element

Event Actions (MoveoOneAction)

ActionDescriptionUse Case
appearComponent becomes visibleScreen loads, element appears
disappearComponent becomes hiddenScreen unloads, element hides
swipeSwipe gestureSwipe navigation, dismiss
scrollScrolling eventsList scrolling, page scrolling
dragDrag gestureDragging elements
dropDrop gestureDropping elements
tapSingle tapButton clicks, navigation
doubleTapDouble tapZoom in, quick actions
longPressLong pressContext menus, options
pinchPinch gestureZoom in/out
zoomZoom actionImage zoom, map zoom
rotateRotation gestureImage rotation
submitForm submissionForm submits, data saves
selectSelection actionItem selection
deselectDeselection actionItem deselection
hoverHover stateMouse hover (web)
focusComponent focusInput focus
blurComponent blurInput blur
inputText inputTyping, text entry
valueChangeValue changesSlider changes, toggle switches
dragStartDrag beginsDrag initiation
dragEndDrag endsDrag completion
refreshRefresh actionPull to refresh
playPlay actionVideo/audio play
pausePause actionVideo/audio pause
stopStop actionVideo/audio stop
seekSeek actionVideo/audio seeking
errorError stateError handling
successSuccess stateSuccess feedback
cancelCancel actionCancel operations
retryRetry actionRetry operations
shareShare actionContent sharing
expandExpand actionExpandable content
collapseCollapse actionCollapsible content
editEdit actionEdit operations
customCustom actionAny other interaction

Comprehensive Example Usage

Here's a complete example showing how to integrate Moveo One Analytics in a Flutter app:

import 'package:flutter/material.dart';
import 'package:moveoone_flutter/moveo_one.dart';
import 'package:moveoone_flutter/models/moveo_one_data.dart';
import 'package:moveoone_flutter/models/constants.dart';

void main() {
// Initialize MoveoOne with your API key
MoveoOne().initialize("your_api_key_here");

// Start tracking session
MoveoOne().start(
"main_app_flow",
metadata: {
"app_version": "1.0.0",
"platform": "mobile",
"user_type": "new_user",
}
);

runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Moveo Analytics Demo',
home: const HomeScreen(),
);
}
}

class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});

@override
State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
final TextEditingController _searchController = TextEditingController();
double _sliderValue = 50.0;

@override
void initState() {
super.initState();

// Track screen appearance
MoveoOne().tick(
MoveoOneData(
semanticGroup: "screen_interaction",
id: "home_screen",
type: MoveoOneType.text,
action: MoveoOneAction.appear,
value: "Home screen loaded",
),
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Home'),
actions: [
IconButton(
icon: const Icon(Icons.settings),
onPressed: () {
// Track settings button tap
MoveoOne().track(
"settings_screen",
MoveoOneData(
semanticGroup: "navigation",
id: "settings_button",
type: MoveoOneType.button,
action: MoveoOneAction.tap,
value: "Settings button clicked",
),
);
// Navigate to settings
},
),
],
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
// Search bar
TextField(
controller: _searchController,
decoration: const InputDecoration(
labelText: 'Search',
border: OutlineInputBorder(),
),
onChanged: (value) {
// Track search input
MoveoOne().tick(
MoveoOneData(
semanticGroup: "user_input",
id: "search_field",
type: MoveoOneType.textEdit,
action: MoveoOneAction.input,
value: value,
),
);
},
),
const SizedBox(height: 20),

// Slider
Text('Volume: ${_sliderValue.round()}%'),
Slider(
value: _sliderValue,
min: 0,
max: 100,
onChanged: (value) {
setState(() {
_sliderValue = value;
});

// Track slider change
MoveoOne().tick(
MoveoOneData(
semanticGroup: "settings",
id: "volume_slider",
type: MoveoOneType.slider,
action: MoveoOneAction.valueChange,
value: value.toString(),
),
);
},
),
const SizedBox(height: 20),

// Action buttons
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {
// Track primary action
MoveoOne().tick(
MoveoOneData(
semanticGroup: "user_actions",
id: "primary_button",
type: MoveoOneType.button,
action: MoveoOneAction.tap,
value: "Primary action executed",
),
);
},
child: const Text('Primary Action'),
),
),
const SizedBox(width: 10),
Expanded(
child: OutlinedButton(
onPressed: () {
// Track secondary action
MoveoOne().tick(
MoveoOneData(
semanticGroup: "user_actions",
id: "secondary_button",
type: MoveoOneType.button,
action: MoveoOneAction.tap,
value: "Secondary action executed",
),
);
},
child: const Text('Secondary Action'),
),
),
],
),
const SizedBox(height: 20),

// Image example
Container(
height: 200,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8),
),
child: GestureDetector(
onTap: () {
// Track image tap
MoveoOne().tick(
MoveoOneData(
semanticGroup: "content_interaction",
id: "sample_image",
type: MoveoOneType.image,
action: MoveoOneAction.tap,
value: "Sample image clicked",
),
);
},
child: const Center(
child: Text('Sample Image (Tap to track)'),
),
),
),
],
),
),
);
}

@override
void dispose() {
// Track screen disappearance
MoveoOne().tick(
MoveoOneData(
semanticGroup: "screen_interaction",
id: "home_screen",
type: MoveoOneType.text,
action: MoveoOneAction.disappear,
value: "Home screen unloaded",
),
);

_searchController.dispose();
super.dispose();
}
}

Obtain API Key

To obtain an API key:

  1. Visit Moveo One App
  2. Sign up for an account
  3. Create a new project
  4. Get your unique API token from the project settings
  5. Contact us at info@moveo.one for integration support

Dashboard Access

Once your data is being tracked, you can access your analytics through the Moveo One Dashboard at https://app.moveo.one/

The dashboard provides:

  • Analytics viewing
  • User behavior patterns
  • Interaction flow visualization
  • Custom report generation
  • Data export capabilities

Support

For any issues or support, feel free to: