From Segment
Replace analytics.js track, identify, and page with Landscape verbs.
Map calls
| Segment | Landscape |
|---|---|
analytics.load(writeKey) |
init({ endpoint }) |
analytics.track(event, properties) |
track(event, properties) |
analytics.identify(userId, traits) |
identify(userId, traits) |
analytics.page(name, properties) |
page(properties) |
analytics.group(…) |
not built in; emit a custom event or fold account fields into traits |
analytics.reset() |
reset() |
analytics.user().traits() updates |
setUserProperties(traits) |
Replace an event
import { init, identify, track } from "@hyperreal/landscape-core";
init({ endpoint: "/api/events" });
track("Order Completed", { revenue: 49.0 });
identify("user_123", { email: "a@b.co" });