Schema for an ecommerce event in the hybrid flow

interface EcomEvent {
    name: "ecom";
    payloads: {
        action: "impressions" | "add" | "remove" | "view";
        currency: string;
        product?: { id: string; name: string; price: number } & {
            id: string;
            name: string;
            price: number;
        };
        products?: null
        | Product[];
        total?: null | number;
    };
}

Properties

Properties

name: "ecom"

Event name

payloads: {
    action: "impressions" | "add" | "remove" | "view";
    currency: string;
    product?: { id: string; name: string; price: number } & {
        id: string;
        name: string;
        price: number;
    };
    products?: null
    | Product[];
    total?: null | number;
}

Event payloads

Type declaration

  • action: "impressions" | "add" | "remove" | "view"

    Ecom action

  • currency: string

    Ecom currency

  • Optionalproduct?: { id: string; name: string; price: number } & {
        id: string;
        name: string;
        price: number;
    }
  • Optionalproducts?: null | Product[]

    Ecom product list

  • Optionaltotal?: null | number

    Ecom total value