analyticsRedirectToShopEventItemId method

  1. @override
Future<Either<Failure, Success>> analyticsRedirectToShopEventItemId(
  1. String url,
  2. String userId,
  3. String itemId
)
override

Implementation

@override
Future<Either<Failure, Success>> analyticsRedirectToShopEventItemId(
    String url, String userId, String itemId) async {
  try {
    dynamic value = {"url": url, "userId": userId, "itemId": itemId};

    if (googleAnalyticsRemoteDS != null) {
      await googleAnalyticsRemoteDS?.sendAnalytics(
          analytics_redirectToShopEventId, value);
    }
    if (rudderStackRemoteDS != null) {
      await rudderStackRemoteDS?.trackEvent(analytics_redirectToShopEventId,
          RudderProperty().putValue(key: analytics_savedItems, value: value));
    }
    return Right(AnalyticsLogsSuccess());
  } catch (e) {
    return Left(RepositoryFailure());
  }
}