Skip to content

Events

Junction uses a structured event model where every event has an entity and an action:

jct.track("product", "viewed", { product_id: "SKU-123" });
// ^^^^^^ ^^^^^^
// entity action

This is different from flat event strings like view_item or addToCart. The entity:action model gives you:

  • Consistent naming — events are always entity:action, never ambiguous
  • Schema validation — define contracts per entity+action pair
  • Destination mapping — each destination translates to its own naming convention
EntityActionDescription
pageviewedPage view
productviewedProduct detail view
productaddedAdded to cart
ordercompletedPurchase completed
formsubmittedForm submission
ctaclickedCall-to-action click

The third argument to track() is a properties object. Properties are passed to destinations after transformation:

jct.track("product", "viewed", {
product_id: "SKU-123",
name: "Junction T-Shirt",
price: 29.99,
currency: "USD",
category: "Apparel",
});

The _system entity is reserved for internal lifecycle events (initialization, consent changes, errors). Destinations automatically filter system events — you don’t need to handle them.

Use identify() to associate events with a user:

jct.identify("user-123", {
email: "user@example.com",
plan: "pro",
});

Anonymous IDs are generated automatically and persist across sessions via localStorage.