trackPageView method

void trackPageView({
  1. required BuildContext context,
  2. String? pvId,
  3. String? path,
  4. Campaign? campaign,
  5. Map<String, String>? dimensions,
  6. PerformanceInfo? performanceInfo,
  7. bool? newVisit,
})

This will register a page view with trackPageViewWithName by using the context.widget.toStringShort() as actionName value.

pvId is a 6 character unique ID that can later be used to associate other actions (like trackEvent) with this page view. If null, a random id will be generated (recommended). Also see attachLastScreenInfo.

path is a string that identifies the path of the screen where this action happend. If not null, it will be appended to contentBase to create a URL. This combination corresponds with url. Also see attachLastScreenInfo. Setting path manually will take precedance over attachLastScreenInfo.

campaign can be a campaign that lead to this action. Setting this multiple times during an apps lifetime can have some side effects, see the Campaign class for more information.

For remarks on dimensions see trackDimensions.

The newVisit parameter can be used to make this action the begin of a new visit. If it's left to null and this is the first track... call after MatomoTracker.initialize, the newVisit from there will be used.

Implementation

void trackPageView({
  required BuildContext context,
  String? pvId,
  String? path,
  Campaign? campaign,
  Map<String, String>? dimensions,
  PerformanceInfo? performanceInfo,
  bool? newVisit,
}) {
  final actionName = context.widget.toStringShort();

  trackPageViewWithName(
    actionName: actionName,
    pvId: pvId,
    path: path,
    campaign: campaign,
    dimensions: dimensions,
    performanceInfo: performanceInfo,
    newVisit: _inferNewVisit(newVisit),
  );
}