mautic_tracking_api 1.0.2

Dart native
Flutter Android iOS

API to Monitoring and Tracking Users using Mautic for Dart and Flutter

mautic_tracking_api #

App User Monitoring and Tracking easily for Dart and Flutter using Mautic: Open Source Marketing Automation Software.

The essence of monitoring what happens in an App is similar to monitoring what happens on a website.

In short, this package use Named Screen Path (e.g. main_screen) in your App as your page_url field in the tracker, Named Screen Title (e.g. Home Screen) as your page_title field and the Contact E-mail as unique identifier. See Mautic Contact Monitoring section for detailed instructions.

This package also use native Mautic Tracking Cookies mtc_id, mtc_sid and mautic_device_id to make Tracking more effective.

Made with ❤️ by Mautic Specialists at Powertic.

Install #

Add this package to your package's pubspec.yaml file:

dependencies:
  mautic_tracking_api:

Run flutter pub get on terminal to download and install packages and import on your main.dart:

import 'package:mautic_tracking_api/mautic_tracking_api.dart';

Usage #

Create a global instance of MauticTracking and import this global instance on all your files.

var MauticTracking mautic;

On your main.dart you can setting up the MauticTracking object:

// Setting Up
void main() async {

  // Start Tracking
  mautic = MauticTracking(
    "https://mkt.mymautic.com",
    appName: "MyApp",
    email: "contact@email.com",
    appVersion: '1.0.0',
    appBundleName: 'com.mydomain.myapp',
  );

  // Track App Start
  await mautic.trackAppStart();

}

When the App is Started, this event will be fired:

Started App

If the contact doesn't exists on Mautic, the contact will be identified by app_started.

Contact Identified

See a complete Flutter example at example/example_app/lib/main.dart

Setting Up #

There are some options to instantiate MauticTracking:

MauticTracking(
    this._base_url, {
    this.email,
    this.appName,
    this.appVersion,
    this.appBundleName,
    this.closeConnectionAfterRequest = true,
    this.userAgent =
        'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)',
  });

These are the constructor options:

PropertyTypeRequiredDescription
_base_urlStringYesMautic Base URL
emailStringNoMautic Contact Email
appNameStringNoApp Name
appVersionStringNoApp Version
appBundleNameStringNoApp Bundle Name
closeConnectionAfterRequestboolNoClose Connection after Request
userAgentStringNoRequest User Agent

Mautic Contact Monitoring #

The act of monitoring the traffic and activity of contacts can sometimes be somewhat technical and frustrating to understand. Mautic Tracking API makes this monitoring simple and easy to configure.

Contact Timeline

Tracking Screens #

Send App Screen info to Mautic.

Screen Track

Method Definition:

Future<void> trackScreen(String screenPath, [String screenName]) async;
PropertyTypeRequiredDescription
screenPathStringYesUnique Screen Route Path
screenNameStringNoUnique Screen Route Label

Usage:

You can send screen tracking info only with screenPath.

Create your screen paths using _ to separate words and always use small caps.

mautic.trackScreen("main");

You can also send screen tracking info using screenPath and screenName. Fell free to use space and capitalized words for Screen Name.

mautic.trackScreen("main", "Main Page");

Tracking Events #

Send App Event info to Mautic.

Event Track

Method Definition:

Future<void> trackEvent(String eventKey, String eventName, String screenPath, [String screenName]) async;
PropertyTypeRequiredDescription
eventKeyStringYesUnique Event Key
eventNameStringYesUnique Event Name
screenPathStringYesUnique Screen Route Path
screenNameStringNoUnique Screen Route Label

Usage:

You can send screen tracking info only with screenPath.

Create your screen paths using _ to separate words and always use small caps.

mautic.trackEvent('click_getting_start', 'Click Get Start Button', 'home');

You can also send screen tracking info using screenPath and screenName. Fell free to use space and capitalized words for Scren Name and Event Name.

mautic.trackEvent('click_getting_start', 'Click Get Start Button', 'home', 'Home Page');

Adding Contact Tags #

Add tag to contact.

Contact Timeline

mautic.addTag({'a', 'b'});
PropertyTypeRequiredDescription
paramsSetYesSet of tag names

Removing Contact Tags #

Remove tag to contact.

Contact Timeline

mautic.removeTag({'a', 'b'});
PropertyTypeRequiredDescription
paramsSetYesSet of tag names

Contribute #

Please file feature requests and bugs at the issue tracker.

2
likes
100
pub points
0%
popularity

Publisher

powertic.com

API to Monitoring and Tracking Users using Mautic for Dart and Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL 3.0 (LICENSE)

Dependencies

http, path

More

Packages that depend on mautic_tracking_api