---
title: Verify Go SDK events
description: "Trace a Go SDK event through each stage: what the SDK captured, how plugins transformed it, what it sent to Amplitude, and what Amplitude received."
product: analytics
lang: en
last_updated: 2026-12-01
token_estimate: 2499
---
# Verify Go 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? | The SDK's log on standard error |
| [Transformed](#check-how-plugins-transformed-the-event) | What did plugins add, change, or drop? | An inspection plugin |
| [Sent](#check-what-the-sdk-sent) | Did the request leave the process, and with what? | The `payloadBytes` log line, or a local capture server |
| [Received](#check-what-amplitude-received) | Did Amplitude accept and store the event? | The upload result in `ExecuteCallback`, then _User Lookup_ |

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 [Go SDK releases on GitHub](https://github.com/amplitude/analytics-go/releases).

## Turn on debug logging

The default logger has no log levels. It writes every message, Debug included, to standard error with Go's standard `log` package. You don't need to turn anything on: run the client with the default `Logger` and read standard error.

```go
package main

import "github.com/amplitude/analytics-go/amplitude"

func main() {
	config := amplitude.NewConfig("AMPLITUDE_API_KEY")
	client := amplitude.NewClient(config)
	defer client.Shutdown()

	client.Track(amplitude.Event{
		EventType:       "Sign Up Completed",
		UserID:          "user-12345",
		EventProperties: map[string]interface{}{"plan": "starter"},
	})
}
```

Each line starts with `amplitude-analytics - `, a timestamp, and the level: `Debug:`, `Info:`, `Warn:`, or `Error:`. Filter standard error on that prefix.

> **Warning:** The default logger writes your API key
>
> On every upload, the default logger writes the full request body, including `api_key`, at the `Debug` level. Because the default logger doesn't filter levels, this happens in production too. Before you deploy, set a `Logger` that drops Debug messages. Go to [Control logging](https://amplitude.com/docs/sdks/analytics/go/go-sdk/instrument-and-configure#control-logging).

## Check what the SDK captured

Each `Track()`, `Identify()`, `GroupIdentify()`, `SetGroup()`, and `Revenue()` call logs the event it accepted:

```text
amplitude-analytics - 2026/11/11 13:04:25 Debug: Client initialized
amplitude-analytics - 2026/11/11 13:04:25 Debug: Track event:
	{EventType:Sign Up Completed EventOptions:{UserID:user-12345 DeviceID: ...} EventProperties:map[plan:starter] ...}
```

Check the log for these problems:

| What you see | What it means |
| --- | --- |
| No `Track event` line | The call never ran, the client already shut down, or `OptOut` is `true`. A client ignores every call after `Shutdown()`. |
| `Error: Invalid event, EventType and either UserID or DeviceID cannot be empty` | The event has no name, or no `UserID` and no `DeviceID`. The SDK sends it anyway, and Amplitude rejects it. |
| `Error: Identify: Empty Properties` | You passed an `Identify` with no operations. The SDK sends nothing. |
| `Error: Invalid Revenue: Either Revenue or Price should be set` | The `Revenue` struct has neither `Price` nor `Revenue`. The SDK sends nothing. |
| `Warn: Identify: Already used property ...` | One `Identify` uses the same property in two operations. Despite the warning's wording, the SDK sends both operations, and Amplitude decides which one applies. Use each property once. |

## Check how plugins transformed the event

The SDK runs plugins in this order: `Before` plugins, then `Enrichment` plugins, then every `Destination` plugin. The built-in `context` plugin is a `Before` plugin that `NewClient()` adds before any of yours. It sets `time` and `insert_id` when they're empty, and always sets `library`. A plugin that returns `nil` drops the event. If a plugin panics, the SDK logs `Error: Panic in plugin <name>.Execute: ...` and passes the event on unchanged.

To inspect events in code, add an `Enrichment` plugin. It runs after the built-in `context` plugin, so it sees the fields the SDK added:

```go
package main

import (
	"encoding/json"
	"log"

	"github.com/amplitude/analytics-go/amplitude"
)

type inspectPlugin struct{}

func (p *inspectPlugin) Name() string                { return "inspect-events" }
func (p *inspectPlugin) Type() amplitude.PluginType  { return amplitude.PluginTypeEnrichment }
func (p *inspectPlugin) Setup(config amplitude.Config) {}

func (p *inspectPlugin) Execute(event *amplitude.Event) *amplitude.Event {
	b, _ := json.Marshal(event)
	log.Printf("Amplitude event: %s", b)
	return event
}

func main() {
	config := amplitude.NewConfig("AMPLITUDE_API_KEY")
	client := amplitude.NewClient(config)
	defer client.Shutdown()

	client.Add(&inspectPlugin{})

	client.Track(amplitude.Event{
		EventType:       "Sign Up Completed",
		UserID:          "user-12345",
		EventProperties: map[string]interface{}{"plan": "starter"},
	})
}
```

The plugin prints the event as the SDK sends it:

```json
{
  "event_type": "Sign Up Completed",
  "user_id": "user-12345",
  "time": 1794431065800,
  "insert_id": "d99fc12f-77d3-40c5-9bb6-6a082fdd0a80",
  "library": "amplitude-go/1.3.1",
  "event_properties": { "plan": "starter" }
}
```

Remove the inspection plugin when you finish, so event payloads don't reach your production logs.

## Check what the SDK sent

A server process has no _Network_ tab. The default logger already writes each request body before the SDK sends it, on a `payloadBytes` line:

```text
amplitude-analytics - 2026/11/11 13:04:25 Debug: payloadBytes:
	{"api_key":"AMPLITUDE_API_KEY","events":[{"event_type":"Sign Up Completed","user_id":"user-12345","time":1794431065800,"insert_id":"d99fc12f-...","library":"amplitude-go/1.3.1","event_properties":{"plan":"starter"}}]}
amplitude-analytics - 2026/11/11 13:04:25 Info: HTTP response code: 200 OK
amplitude-analytics - 2026/11/11 13:04:25 Info: HTTP response body: {"code":200,"events_ingested":1,...}
```

The SDK sends plain JSON. It doesn't compress request bodies. An `options` object with `min_id_length` appears only when you set `MinIDLength`.

To inspect requests without sending them to Amplitude, for example in a test, point `ServerURL` at a local server that answers like Amplitude:

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"

	"github.com/amplitude/analytics-go/amplitude"
)

func main() {
	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		body, _ := io.ReadAll(r.Body)
		fmt.Println(r.Method, r.URL.Path, string(body))
		w.Write([]byte(`{"code":200,"events_ingested":1}`))
	}))
	defer server.Close()

	config := amplitude.NewConfig("AMPLITUDE_API_KEY")
	config.ServerURL = server.URL + "/2/httpapi"
	client := amplitude.NewClient(config)

	client.Track(amplitude.Event{EventType: "Sign Up Completed", UserID: "user-12345"})
	client.Shutdown()
}
```

The server prints one `POST /2/httpapi` line per upload, followed by the request body. Remove `ServerURL` when you finish, so events go to Amplitude again.

## Check what Amplitude received

### Read the upload result

Set `ExecuteCallback` to receive one `ExecuteResult` for each event after its upload finishes. The SDK calls it for events Amplitude accepted and for events it stopped retrying. It doesn't call it for events it plans to retry.

```go
package main

import (
	"log"

	"github.com/amplitude/analytics-go/amplitude"
)

func main() {
	config := amplitude.NewConfig("AMPLITUDE_API_KEY")
	config.ExecuteCallback = func(result amplitude.ExecuteResult) {
		log.Printf("%s: %d %s", result.Event.EventType, result.Code, result.Message)
	}
	client := amplitude.NewClient(config)
	defer client.Shutdown()

	client.Track(amplitude.Event{EventType: "Sign Up Completed", UserID: "user-12345"})
}
```

The callback runs in its own goroutine. In version 1.3.1 and later, `Shutdown()` waits for running callbacks to return. For a failed event, the SDK also logs `Error: <message>: code=<code>, events=[...]`.

| `Code` | `Message` | Meaning |
| --- | --- | --- |
| `200` | `Event sent successfully.` | Amplitude accepted the event. `Code` is the `code` field from Amplitude's response. |
| `400` | `Invalid API key` | The key is wrong, or belongs to the other data center. The SDK drops every event in the request. |
| `400` | `Request missing required field <field>` | Amplitude named a missing request field. The SDK drops every event in the request. |
| `400` | Amplitude's error, such as `Invalid id length for user_id or device_id` | Amplitude rejected this event. The SDK retries the other events in the request. |
| `413` | Amplitude's error | A single event is larger than Amplitude accepts. |
| `429` | `Exceeded daily quota` | The user or device exceeded Amplitude's daily event quota. |
| `408`, `5xx` | `Event reached max retry times 12` | Every attempt timed out or failed, and the SDK reached `FlushMaxRetries`. |
| `0` | `HTTP request failed: ...` | The request never reached a server. The SDK doesn't retry these. |

For how the SDK retries each status, go to [How the SDK uploads events](https://amplitude.com/docs/sdks/analytics/go/go-sdk/instrument-and-configure#how-the-sdk-uploads-events).

### Find the event in Amplitude

1. In Amplitude, open **User Lookup** and search for the `user_id` or `device_id` you sent.
2. Open the **Activity** tab and turn on **Live event updates**.
3. Find the event by name, and confirm its properties.

If the upload result is `200` but the event doesn't appear, check these settings:

- The API key belongs to the project you're viewing.
- The project's data center matches `ServerZone`.

