Skip to content

RudderStack (event pipeline)

This sets up the transport that carries visitor behavior into the engine: a Source (where the UI sends events) and a Destination (a webhook that forwards them to the engine). Done once, by whoever deploys. Application developers only need the Write Key and Data Plane URL this produces (see Integration).

flowchart LR
    ui["UI (RudderStack SDK)"] -->|track / identify| src["Source (JavaScript)"]
    src -->|forward| dst["Destination (Webhook)"]
    dst -->|POST| ingest["/api/ingest"]
    ingest --> redis[("Redis buffer + user model")]
    classDef store fill:#EFEAE0,stroke:#A8895B,color:#423D34;
    class redis store;

1. Create the Source (JavaScript)

  1. RudderStack Cloud → Sources → Add Source → JavaScript. Name it (for example memorise-ui).
  2. Open the source and copy its two values:
Value Used for
Write Key rudderanalytics.load(WRITE_KEY, ...) in the UI
Data Plane URL rudderanalytics.load(..., DATA_PLANE_URL) in the UI
  1. Hand both to the UI developers. That is all they need; see Send Events.

2. Create the Destination (Webhook)

  1. From the same source, Add Destination → Webhook.
  2. Configure it:
Setting Value
Webhook URL https://merely-matrix-naples-jews.trycloudflare.com/api/ingest
Method POST
Headers Content-Type: application/json (added automatically)
  1. Connect the JavaScript source to this Webhook destination so events flow source -> destination.

The Webhook destination forwards each event as a standard RudderStack payload (with event, userId, nested properties, context, timestamp). The engine reads that shape directly, no RudderStack Transformation is required.

Temporary tunnel

*.trycloudflare.com URLs are ephemeral. When the tunnel restarts, update the Webhook URL (or point it at your stable deployment domain). The Data Plane must be able to reach this URL publicly.

3. Events that matter

The UI emits these track events; the engine uses each:

Event Purpose
CONTENT_VIEW_STARTED / CONTENT_VIEW_ENDED dwell, completion, impressions
CONTENT_LOOKUP search and clicks
SURVEY_ANSWERED survey signal, cold start

identify calls bind events to a user_id. Other RudderStack events (page, etc.) are harmless; the normalizer ignores what it does not recognise.

4. Verify

  1. Load a UI page wired with the SDK, or use RudderStack's Send test event.
  2. Watch the source's Live Events tab to confirm events arrive.
  3. Check the destination's delivery / events tab for 200 responses from /api/ingest.
  4. Confirm the model updated:
curl "http://localhost:8000/api/usermodel?user_id=<the user id>"

5. What the engine expects

The webhook receives standard RudderStack track payloads. The recsys normalizer reads nested properties (content, details, context, answers) and userId. The exact shapes are in the event catalog; /api/ingest accepts a single event or a batch.

Once wired, hand the Write Key and Data Plane URL to developers and point them at Send Events.