logPurchase method
Logs the standard purchase
event.
This event signifies that an item(s) was purchased by a user. Note: This is different from the in-app purchase event, which is reported automatically for Google Play-based apps.
Implementation
Future<void> logPurchase({
String? currency,
String? coupon,
double? value,
List<AnalyticsEventItem>? items,
double? tax,
double? shipping,
String? transactionId,
String? affiliation,
Map<String, Object>? parameters,
AnalyticsCallOptions? callOptions,
}) {
_requireValueAndCurrencyTogether(value, currency);
_assertParameterTypesAreCorrect(parameters);
_assertItemsParameterTypesAreCorrect(items);
return _delegate.logEvent(
name: 'purchase',
parameters: filterOutNulls(<String, Object?>{
_CURRENCY: currency,
_COUPON: coupon,
_VALUE: value,
_ITEMS: _marshalItems(items),
_TAX: tax,
_SHIPPING: shipping,
_TRANSACTION_ID: transactionId,
_AFFILIATION: affiliation,
if (parameters != null) ...parameters,
}),
callOptions: callOptions,
);
}