> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselotus.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Tracking product usage is one of the most common operations you'll make in Lotus.
It's used to capture any event that you might want to bill on at any point.

# Tracking

You can track absolutely anything, and with the extensible and customizable properties field, you can add as much information as you want.

<CodeGroup>
  ```python Python theme={null}
  #the python SDK will automatically batch events
  lotus.track_event(
    customer_id='customer123',
    event_name='api_call',
    properties={
        'region': 'US',
        'mb_used': 150
      },
    idempotency_id='c9799bf9-e5c9-4007-8d10-0663d045d23c',
    time_created="2023-01-01T21:58:14.193Z"
  )
  ```

  ```ts Typescript theme={null}
  lotus.trackEvent({
    event_name: "test", // required
    time_created: new Date(), // optional, if not provided current time will be taken
    customer_id: "cust_5894767364aa4e64", // required
    properties: { test: "test", numericQuantity: 3.1415 }, //optional, pass in any additional properties you want to aggregate or measure
    idempotency_id: "c2c5eb5d-de4b-44e0", //optional if not provided Randomly generated ID will be taken
  });

  lotus.trackEvent({
    batch: [
      {
        event_name: "test", // required
        time_created: new Date(), // optional, if not provided current time will be taken
        customer_id: "cust_5894767364aa4e64", // required
        properties: { test: "test", numericQuantity: 3.1415 }, //optional, pass in any additional properties you want to aggregate or measure
        idempotency_id: "c2c5eb5d-de4b-44e0", //optional if not provided Randomly generated ID will be taken
      },
    ],
  });
  ```
</CodeGroup>

***
