React Native Ecommerce Activity Tracking

Reteno's ecommerce tracking allows you to understand customer behavior and use this data for analytics and automation.

This guide shows how to track ecommerce activity in your React Native application using specific logging methods from the SDK.

import {
  logEcomEventProductViewed,
  logEcomEventProductCategoryViewed,
  logEcomEventProductAddedToWishlist,
  logEcomEventCartUpdated,
  logEcomEventOrderCreated,
  logEcomEventOrderUpdated,
  logEcomEventOrderDelivered,
  logEcomEventOrderCancelled,
  logEcomEventSearchRequest,
} from "reteno-react-native-sdk";

Supported Events

FunctionWhen to use it
logEcomEventProductViewedUser opens a product card
logEcomEventProductCategoryViewedUser opens a category or listing page
logEcomEventProductAddedToWishlistUser adds a product to wishlist
logEcomEventCartUpdatedCart items changed (add / remove / quantity update)
logEcomEventOrderCreatedNew order is created
logEcomEventOrderUpdatedOrder is updated after creation
logEcomEventOrderDeliveredOrder marked as DELIVERED
logEcomEventOrderCancelledOrder marked as CANCELLED
logEcomEventSearchRequestUser performs a search query

Usage Pattern

  1. Construct the appropriate payload object.
  2. Pass it to the corresponding log function.
  3. Await the result.
await logEcomEventProductViewed({
  product: {
    productId: "PRODUCT_ID",
    price: 99.99,
    isInStock: true,
    attributes: [
      { name: "color", value: ["red"] },
      { name: "size", value: ["M"] },
    ],
  },
  currencyCode: "USD",
});

Event Reference

Product Viewed

await logEcomEventProductViewed({
  product: {
    productId: "123",
    price: 29.99,
    isInStock: true,
    attributes: [{ name: "color", value: ["blue", "white"] }],
  },
  currencyCode: "EUR",
});
FieldTypeDescription
productEcomProductViewRequired product object
currencyCodestring?Optional ISO‑4217 code (e.g. USD, EUR)

Product Category Viewed

await logEcomEventProductCategoryViewed({
  category: {
    productCategoryId: "CATEGORY_01",
    attributes: [{ name: "gender", value: ["women"] }],
  },
});
FieldTypeDescription
productCategoryIdstringRequired category identifier
attributesEcomAttribute[]?Optional metadata fields

Product Added to Wishlist

await logEcomEventProductAddedToWishlist({
  product: {
    productId: "abc",
    price: 59.99,
    isInStock: true,
    attributes: [],
  },
  currencyCode: "UAH",
});

Same structure as Product Viewed.


Cart Updated

await logEcomEventCartUpdated({
  cartId: "CART-123",
  cartItems: [
    {
      productId: "p1",
      quantity: 2,
      price: 25.0,
      discount: 5.0,
    },
    {
      productId: "p2",
      quantity: 1,
      price: 100.0,
    },
  ],
  currencyCode: "USD",
});
FieldTypeDescription
cartIdstringShopping cart ID
cartItemsEcomCartItem[]Array of cart item details
currencyCodestring?Optional currency

Order Created / Updated

await logEcomEventOrderCreated({
  order: {
    externalOrderId: "ORDER-999",
    totalCost: 200,
    status: OrderStatus.Initialized,
    cartId: "CART-123",
    externalCustomerId: "user-001",
  },
  currencyCode: "USD",
});
FieldTypeDescription
externalOrderIdstringYour system's order ID
totalCostnumberTotal amount charged
statusOrderStatusOne of: Initialized, InProgress, Delivered, Cancelled
cartIdstring?Related cart ID (optional)
currencyCodestring?ISO‑4217 currency code

Order Delivered / Cancelled

await logEcomEventOrderDelivered({ externalOrderId: "ORDER-999" });

await logEcomEventOrderCancelled({ externalOrderId: "ORDER-999" });

Search Request

await logEcomEventSearchRequest({
  searchQuery: "running shoes",
  isFound: true,
});
FieldTypeDescription
searchQuerystringWhat the user searched for
isFoundbooleanWhether results were found

Currency Codes

Always use valid ISO‑4217 currency codes:

  • USD
  • EUR
  • UAH

If no code is provided, your organization's default will be used.