Help
The Clickstream Publisher lets you capture real-time behavioural events from your website or mobile app — page views, button taps, screen transitions, and custom events — and route them directly into a SurveyAnalytica workflow. Each event arrives as structured data that workflow conditions and actions can act on immediately.
How it works
You install a lightweight SDK in your app or site. The SDK collects events, batches them, and sends them to a dedicated endpoint tied to one workflow. That workflow can write events to a data table, update a contact record, trigger a survey, or run any other action you configure.
Each source (website, iOS app, Android app) gets its own workflow with its own API key and endpoint URL, so you can control data routing and access independently.
Step 1 — Create a Clickstream workflow
- Go to Flows and click Create workflow.
- Name the workflow (for example, Website Clickstream or iOS App Events).
- Click the Trigger step and choose Clickstream from the trigger type list.
Step 2 — Copy your API Key and Endpoint URL
After selecting the Clickstream trigger, the trigger drawer shows:
- KEY — your API key. The SDK sends this with every request to authenticate.
- URL — the endpoint your SDK posts events to. It looks like
https://<your-domain>/api/v1/clickstream/<workflow-id>.
Use the copy icons next to each value. You will need both when initialising the SDK.
Click Generate New under the KEY to rotate the API key at any time. After rotating, update the key in your SDK configuration — the old key stops working immediately.
Step 3 — Install the SDK
Choose the guide for your platform:
- Web SDK — for websites built with Vanilla JS, Next.js, or React.
- Mobile SDKs — for React Native, Flutter, iOS (Swift), and Android (Kotlin).
Step 4 — Configure workflow actions
With the trigger active, add actions to handle the incoming events. A typical Clickstream workflow includes:
- A Condition block that checks the event type (for example, eventType equals uid_transition) to separate identity-resolution events from regular events.
- A Data action to write each event as a new row in a data table — use the clickstream field mapping template that appears automatically when you create a new table inside a Clickstream workflow.
- A Contact action on the uid_transition branch to update the contact’s anonymous ID list, linking pre-login events to the known contact.
Event types
| Event type | When it fires |
|---|---|
event |
Any named event you track manually, including automatic page views (eventName: page_view). |
uid_transition |
When a user logs in and the SDK links their anonymous session to their known contact ID. |
consent_rejected |
When your app calls setConsent(false). Tracking stops and prior anonymous IDs are cleared. |
Activating the workflow
Click Activate in the workflow builder. The endpoint is live immediately. Events sent by the SDK before the workflow is activated are not received — activate before deploying the SDK to your users.