---
title: Verify Python SDK events
description: "Trace an Amplitude Python SDK event through each stage: what the SDK accepted, how plugins transformed it, what it uploaded, and what Amplitude received."
product: analytics
lang: en
last_updated: 2026-11-30
token_estimate: 2649
---
# Verify Python SDK events

An event moves through four stages between your `track()` call and Amplitude's servers. Verify each stage in order. The first stage where the event looks wrong is where the problem is.

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

| Stage | Question | Where to look |
| --- | --- | --- |
| [Captured](#check-what-the-sdk-captured) | Did the SDK accept the call? | `amplitude` log lines, and the event object |
| [Transformed](#check-how-plugins-transformed-the-event) | What did plugins add, change, or drop? | An inspection plugin |
| [Sent](#check-what-the-sdk-sent) | Which URL did the SDK call, and with what payload? | `client.configuration.server_url`, the event body |
| [Received](#check-what-amplitude-received) | Did Amplitude accept and store the event? | The callback result, then **User Lookup** in Amplitude |

For problems common to every Amplitude SDK, go to [SDK troubleshooting and debugging](https://amplitude.com/docs/sdks/sdk-debugging). If behavior changed after an SDK upgrade, check the [Amplitude-Python changelog](https://github.com/amplitude/Amplitude-Python/blob/main/CHANGELOG.md).

## Turn on debug logging

The SDK logs through Python's `logging` module on the logger named `amplitude`. Validation errors log at `ERROR`, and the result of each upload logs at `INFO`, one line per event. Python hides `INFO` by default, so set the level while you verify:

```python
import logging
from amplitude import Amplitude, BaseEvent

logging.basicConfig(level=logging.INFO)
logging.getLogger("amplitude").setLevel(logging.DEBUG)

client = Amplitude("AMPLITUDE_API_KEY")
client.track(BaseEvent("Report Exported", user_id="user-12345"))
# INFO:amplitude:Event sent successfully.
```

Each per-event log record stores the event and the response code in the `event` and `code` attributes of the `LogRecord`. A custom handler or filter can read these attributes. To move the per-event lines to `DEBUG`, or turn them off, set [`event_log_level`](https://amplitude.com/docs/sdks/analytics/python/python-sdk/reference#logging). `event_log_level` requires 1.3.0 or later.

## Check what the SDK captured

`track()`, `identify()`, `group_identify()`, and `revenue()` validate their input in your thread, before the SDK queues anything. A rejected call logs one of these lines and sends nothing:

| Log line | Cause |
| --- | --- |
| `Invalid event body {...}`, followed by an `InvalidEventError` traceback | The event has neither `user_id` nor `device_id`, or its `event_type` is empty. |
| `Skipped event for opt out config` | `client.configuration.opt_out` is `True`, or the client has shut down. |
| `Empty identify properties` or `Empty group identify properties` | The `Identify` object has no operations. |
| `Key or clear all operation already set.` | The `Identify` object already has an operation for that property, or `clear_all()` ran. |
| `Invalid price for revenue event` | `Revenue.price` isn't a `float` (an `int` such as `4` fails), or `quantity` isn't a positive `int`. |
| `Event property <name> expected <type> but received <type>.` | An event field has the wrong type, for example `time` as a `float`. The SDK drops the field. |
| `Too many properties. 1024 maximum.` | A property dictionary has more than 1,024 keys. The SDK sends it empty. |

One failure produces no log line: when a property dictionary contains a value of an unsupported type, such as a `datetime` or a custom object, the SDK discards the whole dictionary. Check the event object before you track it:

```python
from datetime import datetime
from amplitude import BaseEvent

event = BaseEvent(
    "Report Exported",
    user_id="user-12345",
    event_properties={"exported_at": datetime.now()},
)
print(event.event_properties)
# None: datetime isn't a supported value type, so the SDK discarded the dictionary
```

Supported property values are strings, numbers, booleans, `Enum` members (sent as their `.value`), `None` (dropped from the payload), lists of those, and nested dictionaries. Convert anything else, for example `datetime.now().isoformat()`.

## Check how plugins transformed the event

After validation, each event passes through the plugin pipeline in a fixed order, in the thread that called `track()`:

1. **Before plugins** (`PluginType.BEFORE`): The built-in context plugin sets `time` and `insert_id` if they're empty, adds the configured `plan` and `ingestion_metadata`, and sets `library` to `amplitude-python/<version>`.
2. **Enrichment plugins** (`PluginType.ENRICHMENT`): Your enrichment plugins run here, in the order you added them. A plugin that returns `None` drops the event.
3. **Destination plugins** (`PluginType.DESTINATION`): The built-in Amplitude destination checks that the event has an ID, then queues it. Each destination receives its own copy of the event.

To see the event exactly as the destinations receive it, add an enrichment plugin after your own plugins. The following plugin prints each event and returns the event unchanged:

```python
from amplitude import Amplitude, BaseEvent, EventPlugin, PluginType

class InspectEvents(EventPlugin):
    def __init__(self):
        super().__init__(PluginType.ENRICHMENT)

    def execute(self, event):
        print("final event:", event)
        return event

client = Amplitude("AMPLITUDE_API_KEY")
client.add(InspectEvents())
client.track(BaseEvent("Report Exported", user_id="user-12345"))
```

`print(event)` writes the event as the JSON object the SDK uploads. Remove the plugin with `client.remove(plugin)` when you're done. Exceptions inside a plugin don't reach your code. The SDK logs each exception as `Error for apply ENRICHMENT plugin for event ...` with a traceback. The SDK then continues with the event as it was before that plugin ran.

## Check what the SDK sent

The SDK uploads with an HTTPS `POST` from a background thread. The SDK has no request log, so check the URL and the event body directly.

| Configuration | Request URL |
| --- | --- |
| Default (US) | `https://api2.amplitude.com/2/httpapi` |
| `server_zone="EU"` | `https://api.eu.amplitude.com/2/httpapi` |
| `use_batch=True` (US) | `https://api2.amplitude.com/batch` |
| `use_batch=True` (EU) | `https://api.eu.amplitude.com/batch` |
| `server_url` set | The URL you set |

`client.configuration.server_url` returns the URL the client uses. The SDK uploads queued events every `flush_interval_millis` (10 seconds by default), or sooner when `flush_queue_size` (200 by default) events are ready. Each request carries up to `flush_queue_size` events. Request bodies are uncompressed JSON, so a proxy or packet capture shows them as sent.

The request body has this shape:

```python
from amplitude import Amplitude, BaseEvent

client = Amplitude("AMPLITUDE_API_KEY")
client.track(
    BaseEvent(
        "Sign Up Completed",
        user_id="user-12345",
        event_properties={"plan": "starter"},
    )
)
```

```json
{
  "api_key": "AMPLITUDE_API_KEY",
  "events": [
    {
      "event_type": "Sign Up Completed",
      "user_id": "user-12345",
      "event_properties": { "plan": "starter" },
      "time": 1762780800000,
      "insert_id": "5f1c8e2a-9b0d-4c6e-8f3a-2d7b1e4c9a60",
      "library": "amplitude-python/1.3.0"
    }
  ]
}
```

The SDK sets only the fields you pass plus `time`, `insert_id`, and `library`. The SDK doesn't add device, platform, IP, or location fields. To attribute an event to your end user's location rather than your server's, set [`ip` or the location fields](https://amplitude.com/docs/sdks/analytics/python/python-sdk/reference#eventoptions) on the event. When you set `min_id_length`, the body also carries `"options": {"min_id_length": <n>}`.

## Check what Amplitude received

### Read the upload result

The client-level `callback` in `Config` and the `callback` argument of an individual event run when the event reaches a final upload result: success or final failure. Both callbacks receive `(event, code, message)`:

```python
from amplitude import Amplitude, BaseEvent

def on_result(event, code, message):
    print(event.event_type, code, message)

client = Amplitude("AMPLITUDE_API_KEY")
client.track(BaseEvent("Report Exported", user_id="user-12345", callback=on_result))
# Report Exported 200 Event sent successfully.
```

| `code` | `message` | Meaning | What the SDK does |
| --- | --- | --- | --- |
| `200` | `Event sent successfully.` | Amplitude accepted the event. | Removes the event from the queue. |
| `400` | Server error text, for example `Invalid id length for user_id or device_id` | Amplitude rejected this event. | Drops the events the server marked invalid or silenced, and retries the rest of the batch. |
| `400` | `Request missing required field <field>` | The request lacked a required field. | Drops every event in the batch. |
| `413` | Server error text | A single event was too large. | Drops the event. For a batch, the SDK lowers its batch size and retries. |
| `429` | `Exceeded daily quota` | The user or device exceeded its daily event quota. | Drops the event. Throttled events under the quota retry after 30 seconds without a callback. |
| Last status, or `-1` | `Event reached max retry times 12.` | Every attempt failed with a timeout, a `5xx` status, or a network error (`-1`). | Drops the event after `flush_max_retries` failed attempts. |
| Any | `Destination buffer full. Retry temporarily disabled` | 20,000 or more events were waiting when a failed event came back for retry. | Drops that event. |

A rejected API key (`400` with `Invalid API key: ...` from the server) doesn't reach the callback. The SDK logs `Invalid API Key` at `ERROR` and drops the batch.

A `200` response means Amplitude's ingestion API accepted the event. Amplitude can still exclude an accepted event from analysis later, for example when a [block filter](https://amplitude.com/docs/data/remove-invalid-data) matches it.

### Find the event in Amplitude

1. Open **User Lookup** and search for the event's `user_id`, or its `device_id` if you sent only that.
2. Select the **Activity** tab and turn on **Live event updates**.
3. Open the event and compare its properties with the `final event` output from your inspection plugin.

For events from many users, use the [Ingestion Debugger](https://amplitude.com/docs/analytics/debug-analytics#ingestion-debugger) to review accepted and rejected requests for the project. Charts can take a few minutes longer to include new events than User Lookup does.

