logAdImpression method

Future<void> logAdImpression({
  1. String? adPlatform,
  2. String? adSource,
  3. String? adFormat,
  4. String? adUnitName,
  5. double? value,
  6. String? currency,
  7. Map<String, Object?>? parameters,
  8. AnalyticsCallOptions? callOptions,
})

Logs the standard ad_impression event.

This event signifies when a user sees an ad impression. Note: If you supply the value parameter, you must also supply the currency parameter so that revenue metrics can be computed accurately.

See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#AD_IMPRESSION

Implementation

Future<void> logAdImpression({
  String? adPlatform,
  String? adSource,
  String? adFormat,
  String? adUnitName,
  double? value,
  String? currency,
  Map<String, Object?>? parameters,
  AnalyticsCallOptions? callOptions,
}) {
  _requireValueAndCurrencyTogether(value, currency);

  _assertParameterTypesAreCorrect(parameters);

  return _delegate.logEvent(
    name: 'ad_impression',
    parameters: filterOutNulls(<String, Object?>{
      _AD_PLATFORM: adPlatform,
      _AD_SOURCE: adSource,
      _AD_FORMAT: adFormat,
      _AD_UNIT_NAME: adUnitName,
      _VALUE: value,
      _CURRENCY: currency,
      if (parameters != null) ...parameters,
    }),
    callOptions: callOptions,
  );
}