For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Add custom events for actions Autocapture can't capture
このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。
Custom events are optional. With Autocapture turned on, Amplitude collects page views, sessions, clicks, form interactions, file downloads, and more without tracking code. Visual labeling turns any captured click into a named event, such as Sign up clicked, without code. Visual labeling events work retroactively, because Autocapture already captured the underlying interactions.
Add a custom event with an explicit track call when Autocapture can't see the action or can't attach the context you need:
- The action completes on your servers, such as a confirmed purchase or a completed sign-up.
- The event needs business properties, such as plan, price, or order ID, that aren't in the page.
- The action happens in an environment Autocapture doesn't cover. Autocapture supports the Browser, iOS, Android, and Flutter SDKs.
Prerequisites
- An Amplitude SDK installed and sending events. To install one, go to Install Amplitude.
- Access to the code that runs when the action completes.
Send a custom event with properties
Track
Call track when the action completes
Pass the event name and an object of event properties. This example uses the Browser Unified SDK:
javascriptimport { track } from "@amplitude/unified"; track("Button Clicked", { buttonId: "signup" });The track call for each other SDK appears on its install page: mobile SDKs, server SDKs, or the HTTP API. To decide whether an event belongs on the client or the server, go to Client-side vs Server-side.
Confirm
Confirm the event in Amplitude
Trigger the action in your product, then open the Amplitude Debugger and check that the event arrives with its properties.
For help choosing which actions deserve custom events, go to What events do you need.
これは役に立ちましたか?