Zeba Academy User Behavior Tracker

GPL License

A Flutter package to track user interactions in your app: taps, scroll depth, rage clicks, and session replay.


Features

  • Tap Heatmap Tracking – Record all user taps for analytics or visualization.
  • Scroll Depth Tracking – Measure how far users scroll in your app.
  • Rage Click Detection – Detect multiple clicks in the same area within a short time.
  • Basic Session Replay – Capture and export user events to replay sessions.
  • Lightweight & No-Bloat – Focused analytics, minimal footprint.

Installation

Add this to your pubspec.yaml:

dependencies:
  zeba_academy_user_behavior:
    git:
      url: https://github.com/your-github/zeba_academy_user_behavior.git

Then run:

flutter pub get

Usage

Wrap your app with BehaviorTracker and ScrollTracker

import 'package:flutter/material.dart';
import 'package:zeba_academy_user_behavior/zeba_academy_user_behavior.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SessionManager().startSession();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BehaviorTracker(
      onTap: (pos) => print('Tap at \$pos'),
      onRageClick: (pos) => print('Rage click detected at \$pos'),
      child: ScrollTracker(
        onScrollPercent: (percent) => print('Scrolled: \$percent%'),
        child: MaterialApp(
          home: Scaffold(
            body: ListView.builder(
              itemCount: 50,
              itemBuilder: (_, i) => ListTile(title: Text('Item \$i')),
            ),
          ),
        ),
      ),
    );
  }
}

Session Replay

final sessionReplay = SessionReplay();

// log taps
sessionReplay.logTap(Offset(100, 200));

// log scroll
sessionReplay.logScroll(50.0);

// export session events
final eventsJson = sessionReplay.export();
print(eventsJson);

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for details.


About Me

✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin


Your all-in-one no-bloat hub!

🚀 Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! 💻✨

Zeba Academy is a learning platform dedicated to coding, technology, and development. ➡ Visit our main site: zeba.academy ➡ Explore hands-on courses and resources at: code.zeba.academy ➡ Check out our YouTube for tutorials: zeba.academy ➡ Follow us on Instagram: zeba.academy

Thank you for visiting!