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

# Server-side events with no logged-in user

> What to set distinct_id to on server-side events that have no identified user, why omitting it groups unrelated users together, and the ID values Mixpanel rejects

You are sending events from a server where no user is logged in — a webhook, a cron job, a system event — and there is no obvious value for `distinct_id`. Set it to the empty string.

```json theme={"system"}
{
  "event": "Subscription Renewed",
  "properties": {
    "time": 1618716477000,
    "distinct_id": "",
    "$insert_id": "29fc2962-6d9c-455d-95ad-95b84f09b9e4"
  }
}
```

Events with an empty distinct\_id will be excluded from all behavioral analysis. They are still ingested and still queryable as event volume; they just cannot participate in per-user analysis, which is the correct outcome for an event that belongs to no user.

## Do Not Omit `distinct_id`

If you leave it out entirely, Mixpanel will use the ip address of the incoming request and compute a distinct\_id using a hash function.

Every event from the same server then shares one synthetic user. That is worse than the empty string: it silently invents a user, inflates per-user metrics, and can concentrate enough volume on a single ID to trigger [hot shard limits](https://docs.mixpanel.com/docs/tracking-best-practices/hot-shard-limits.md).

The empty string avoids this. Mixpanel spreads those events across shards rather than keying them to one ID.

## Do Not Use a Placeholder

Mixpanel rejects a list of values that usually indicate a mistake:

```text theme={"system"}
00000000-0000-0000-0000-000000000000, anon, anonymous, nil, none, null,
n/a, na, undefined, unknown, <nil>, 0, -1, true, false, [], {}
```

An event carrying one of these fails validation with a [400](https://docs.mixpanel.com/troubleshooting/errors/400-bad-request.md). The same list applies to `$insert_id`.

## When There Is a User

If the event does belong to a known user, Mixpanel recommends not setting the `distinct_id` directly; instead you should set the `$device_id` and `$user_id` and have our API determine the `distinct_id` for you.

On Simplified ID Merge, `distinct_id` is derived automatically: it takes the value of `$user_id` when present, otherwise `$device_id` prefixed with `$device:`. If you do set it manually, it should be the same value as the `$user_id`.

> [!NOTE]
>
> This page describes Simplified ID Merge, the default for organizations created from April 2024. Check which system your project uses in [project settings](https://mixpanel.com/settings/project/id-management). On Original ID Merge, server-side anonymous events set `distinct_id` to the anonymous ID directly and identification happens through a `$identify` event.

## Related

* [Identifying Users (Simplified)](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified.md)
* [Import Events API](https://docs.mixpanel.com/reference/import-events.md)
* [400 Bad Request](https://docs.mixpanel.com/troubleshooting/errors/400-bad-request.md)
