Events
Track page views, custom events, and identified visitors with the Node SDK.
The Node SDK sends events after init. You can call init from JavaScript without React; with the React provider you usually skip init and import page / track / identify from @amplifyup/sdk. Composer preview and preview iframes do not send visitor events.
import { init, page, track, identify } from '@amplifyup/sdk';
await init({ trackingId: 'your-tracking-id' });
page('/home');
track('Product Viewed', { productId: '123' });
identify('user-123', { email: 'user@example.com' });
With AmplifyUpProvider you usually do not call init yourself.
| Call | Purpose |
|---|---|
page(path) | Page view |
track(name, properties) | Named event (clicks, conversions, custom) |
identify(userId, traits) | Attach a known user to the visitor |
Events show up in Insights after they are processed.
If you are not using the Node SDK, see POST /v1/page and POST /v1/track.