API Reference
API Reference
  1. track(String verb, {String? category, dynamic value})
    Tracks a custom event with a specified verb, along with optional category and value.
    Parameters:

    • verb: String, required – A name of the event to track (e.g. click, buy, like, open)
    • category: String, optional – An optional category name.
    • value: dynamic, optional – An optional value associated with the event.
    Future<MocaResult<dynamic>> track(String verb, {String? category, dynamic value});
    
  2. trackViewed(String item, {String? category, bool? recommended})
    Tracks the viewing of an item, optionally marking it as recommended.
    Parameters:

    • item: String, required – The identifier of the viewed item (e.g. product ID or SKU)
    • category: String, optional – Optional category for the item (e.g. product category ID or name)
    • recommended: bool, optional – Indicates if the item was recommended (default is false if not provided).
    Future<MocaResult<dynamic>> trackViewed(String item, {String? category, bool? recommended});