cux_analytics_sdk 0.0.24 copy "cux_analytics_sdk: ^0.0.24" to clipboard
cux_analytics_sdk: ^0.0.24 copied to clipboard

This is an analytics SDK from CUX.io

Features #

The CUX Analytics SDK integrates with Flutter (Android and iOs) applications to automatically detect user activities. With the addition of a few lines of code you can monitor and analyze your entire application to understand how the user uses it. The result of such monitoring is presented on CUX Analytics Dashboard.

Getting started #

In order to use the CUX Analytics SDK you first need to create a CUX account: https://app.cux.io

Usage #

For Android check internet permission

    void main() {
  print("CuxSDK: main()");
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    print("CuxSDK: MyApp build()");

    CuxAnalytics.init(
        context, '1428112091.0.46456300.1480349278.583c565e0fc5d');
    return AnalyticsWidget(
      child: MaterialApp(
          title: 'Flutter CUX Demo',
          ...
          home: const HomeWidget(),
      navigatorObservers: [
        CuxAnalytics.createNavigationObserver(context, this)
      ],
    ),
    );
  }
}
copied to clipboard

If you need to approve collecting user’s data you can init disabled SDK and start collecting data after the confirmation that collecting data are allowed:

CuxAnalytics.init(context, {token}, needConfirmToStart: true);
copied to clipboard
CuxAnalytics.resumeCollectingData();
copied to clipboard

If you use go_router add RouterNavigationListener:

@override
Widget build(BuildContext context) {
  return MaterialApp.router(
    routerConfig: _router,
    debugShowCheckedModeBanner: false,
    onNavigationNotification:
    RouterNavigationListener(rootWidget: this).onNavigationNotification,
  );
}
copied to clipboard

If pages in your app are not MaterialApp or Scaffolds then for better navigation observability wrap widgets of your screens in DestinationWidget with unik destination name:

@override
Widget build(BuildContext context) {
  return DestinationWidget(
      destinationName: "Destination_$name",
      child: Column(...
copied to clipboard

Additionally you can mask some parts of your screens that contain sensitive information. Best practice for masking: always mask not just only sensitive information but some bigger part of screen, especially if this is a scrollable screen.

import 'package:cux_analytics_sdk/masking_widget.dart';

MaskingWidget(
  child: Padding(
  padding: EdgeInsets.all(16.0),
  child: Text('Masked text'),
)),
copied to clipboard

You can stop collecting data at any moment:

CuxAnalytics.stopCollectingData();
copied to clipboard

You can resume collecting data if you inited disabled SDK or if you stopped data:

CuxAnalytics.resumeCollectingData();
copied to clipboard

Additional information #

This is an SDK for Android and iOs Flutter apps.

You can monitor such data:

  • Activities and Fragments opening with class names and arguments;
  • Screen size, screen rotation;
  • Clicks on clickable and long clickable elements, selection of checkable elements, scrolls, touches;
  • Android system, device and network parameters;
  • Keyboard opening and closing.
  • This list will be expanded in the next versions of SDK.

All data are presented on CUX Dashboard in Visits and HeatMaps etc. https://help.cux.io/support/solutions/articles/103000320480-flutter

0
likes
100
points
328
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.26 - 2025.04.10

This is an analytics SDK from CUX.io

Documentation

API reference

License

MIT (license)

Dependencies

connectivity_plus, device_info_plus, equatable, flutter, flutter_keyboard_visibility, image, image_gallery_saver_plus, intl, package_info_plus, shared_preferences, uuid, visibility_detector

More

Packages that depend on cux_analytics_sdk