MatomoTracker class

Constructors

MatomoTracker()
This is only used for testing purpose, because testing singleton is hard.

Properties

contentBase String
URL for the current action.
latefinal
cookieless bool
no setter
currentScreenId String?
6 character unique ID that identifies which actions were performed on a specific page view.
getter/setter pair
customHeaders Map<String, String>
Custom http headers to add to each request.
latefinal
getAuthToken String?
no setter
hashCode int
The hash code for this object.
no setterinherited
initialized bool
no setter
log → Logger
final
optOut bool
no setter
queue Queue<MatomoEvent>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenResolution Size
The resolution of the device the visitor is using, eg 1280x1024.
latefinal
session ↔ Session
latefinal
siteId int
latefinal
timer Timer
getter/setter pair
url String
latefinal
userAgent String?
The user agent is used to detect the operating system and browser used.
latefinal
visitor Visitor
no setter

Methods

clear() → void
Clear the following data from the local storage:
dispatchEvents() FutureOr<void>
Iterate on the events in the queue and send them to Matomo.
dispose() → void
Cancel the timer which checks the queued events to send. (This will not clear the queue.)
getUserAgent({DeviceInfoPlugin? deviceInfoPlugin}) Future<String?>
initialize({required int siteId, required String url, String? visitorId, String? contentBaseUrl, int dequeueInterval = 10, String? tokenAuth, LocalStorage? localStorage, PackageInfo? packageInfo, PlatformInfo? platformInfo, bool cookieless = false, Level verbosityLevel = Level.off, Map<String, String> customHeaders = const {}}) Future<void>
Initialize the tracker.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
resume() → void
setOptOut({required bool optOut}) Future<void>
setVisitorUserId(String? userId) → void
toString() String
A string representation of this object.
inherited
trackCartUpdate(List<TrackingOrderItem>? trackingOrderItems, num? subTotal, num? taxAmount, num? shippingCost, num? discountAmount, {Map<String, String>? dimensions}) → void
trackDimensions(Map<String, String> dimensions) → void
trackEvent({required String eventCategory, required String action, String? eventName, int? eventValue, Map<String, String>? dimensions}) → void
trackGoal(int goalId, {double? revenue, Map<String, String>? dimensions}) → void
trackOrder(String? orderId, List<TrackingOrderItem>? trackingOrderItems, num? revenue, num? subTotal, num? taxAmount, num? shippingCost, num? discountAmount, {Map<String, String>? dimensions}) → void
trackScreen(BuildContext context, {required String eventName, String? currentScreenId, String? path, Map<String, String>? dimensions}) → void
This will register an event with trackScreenWithName by using the context.widget.toStringShort() value.
trackScreenWithName({required String widgetName, required String eventName, String? currentScreenId, String? path, Map<String, String>? dimensions}) → void
Register an event with eventName as the event's name and widgetName as the event's action.
trackSearch({required String searchKeyword, String? searchCategory, int? searchCount, Map<String, String>? dimensions}) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance MatomoTracker
final