Skip to content

kurtinge/flutter_heap_analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heapanalytics

Heap Analytics

A dart wrapper for Heap.io Analytics

How to use

Here is an exampel app to demonstrate how to use the plugin.

After you have initiated the class you have the track and userInformation functions. userInformation is used to add extra data to the user. track is used to track events.

    int _counter = 0;
    // This can be any string, email, an id, etc.
    String _identity = 'the-identity-of-the-user';

    HeapAnalytics heap = HeapAnalytics(
      appId: 'your-app-id-from-heap',
      errorHandler: (e) => {
          print(e);
      }
    );

    heap.userProperties(
      identity: _identity,
      properties: {
        'email': '[email protected]',
        'firstname': 'John',
        'lastname': 'Doe',
        'language': 'English',
      },
    );

    _counter++;
    heap.track(
      identity: _identity,
      event: 'Increment Button', 
      properties: {
        'platform': 'Mobile',
        'subject': "Clicked the increment button",
        'new_count': _counter
      },
    );

About

Heap.io Analytics package for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published