trackCartUpdate method
Tracks a cart update.
To associate this action with a page view, enable attachLastScreenInfo and
leave pvId
to null
here or set pvId
to the pvId
of that page view
manually, e.g. TraceableClientMixin.pvId. Setting pvId
manually will
take precedance over 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 trackCartUpdate({
List<TrackingOrderItem>? trackingOrderItems,
num? subTotal,
num? taxAmount,
num? shippingCost,
num? discountAmount,
String? pvId,
String? path,
Campaign? campaign,
Map<String, String>? dimensions,
bool? newVisit,
}) {
_initializationCheck();
validateDimension(dimensions);
return _track(
MatomoAction(
// goalId should be set to 0 to track an ecommerce interaction
goalId: 0,
trackingOrderItems: trackingOrderItems,
subTotal: subTotal,
taxAmount: taxAmount,
shippingCost: shippingCost,
discountAmount: discountAmount,
pvId: _inferPvId(pvId),
path: _inferPath(path),
campaign: campaign,
dimensions: dimensions,
newVisit: _inferNewVisit(newVisit),
),
);
}