⚡ ⚡ Learn how Investing.com uses Jitsu to move data faster
Customer Stories

How Embeddables runs customer-facing funnel analytics on Jitsu and ClickHouse

Embeddables (YC S18) is an end-to-end platform that helps health and wellness brands build personalized digital experiences, from websites and intake funnels to checkouts and web portals, with analytics, experimentation, hosting and version control built in.

With Jitsu, Embeddables collects browser events from the experiences it hosts, shapes them with Jitsu Functions, and loads them into ClickHouse, which powers the analytics each brand sees in its Embeddables dashboard.

logo

Event Streams

webWebsite

Server Destinations

clickhouseClickHouse Cloud
cloudflareCloudflare R2
Volume
2 billion+
events per month

Introduction

The analytics in Embeddables are customer-facing. Embeddables collects activity on behalf of the brands that use it, not only on its own website, so a brand can log in and see what people are doing in its funnels. That ranges from an overview of funnel performance down to a single submission.

Jitsu has collected those events since 2022. Today it handles traffic from more than 1.5 million unique visitors a week across Embeddables experiences.

Success meant having a dependable event-collection pipeline that could grow with our customers without becoming harder for our team to maintain.
jeremy.jpg
Jeremy Evans
Co-founder and CTO, Embeddables

The challenge

Before Jitsu, Embeddables collected events with a homegrown pipeline built on Firebase. Over time it became unreliable, and it was getting harder to scale and to maintain.

The team wanted to stop running that infrastructure itself. It still needed control over how each event is transformed, because every page view, button click and form submission has to become a record in the shape the Embeddables dashboard reads.

Why Jitsu

Jitsu took over collection and delivery, and kept the transformation logic in JavaScript the Embeddables team writes itself.

“The important combination for us is collecting browser events, running our own custom JavaScript transformations, and delivering the results to ClickHouse in batches. We can take an event such as a page view, button click or form submission and shape it into the records our product needs.”

Embeddables first ran the open-source version of Jitsu, then moved to Jitsu Cloud in 2022 so the team would not have to scale it themselves.

How the pipeline works

Every event takes the same path, from a visitor's click to the chart a brand sees. Jitsu Functions do the shaping, and Jitsu loads the results into ClickHouse Cloud in batches.

How an Embeddables event becomes a funnel chart: more than 1.5 million unique visitors a week use Embeddables websites, landing pages, PDPs, quizzes, onboarding funnels, checkouts and web portals. Their page views, button clicks and form submissions go to Jitsu Cloud, where a Jitsu Function written in JavaScript shapes each event into a record. Jitsu loads the records into ClickHouse Cloud in batches, and the Embeddables dashboard queries them to show each brand its funnels, from an overview down to a single submission. Supabase and Cloudflare complete the stack.

Changing ClickHouse tables without a gap in the data

Embeddables changes how incoming events are written to its analytics tables in one place: the Jitsu Function that sits between the browser and ClickHouse.

“When we updated our ClickHouse tables, we changed the function to write incoming data to both sets of tables while we validated the change. That let us keep collecting into the existing tables during the transition.”

Changing ClickHouse tables without a gap in the data. Before: the Jitsu Function writes each incoming event to the existing tables. While validating: the Function returns two records per event, one for the existing tables and one for the new tables, so collection into the existing tables never pauses. After: the old entry comes out of the Function and the new tables carry on alone.

A Jitsu Function that returns an array writes one incoming event as several records, and the JITSU_TABLE_NAME field sets the table each record goes to. A simplified version of the pattern, not Embeddables' production code:

export default async function (event) {
  const row = {
    message_id: event.messageId,
    timestamp: event.timestamp,
    event: event.event || event.type,
    page_path: event.context?.page?.path,
  };
  return [
    { ...row, JITSU_TABLE_NAME: "events" },    // existing table
    { ...row, JITSU_TABLE_NAME: "events_v2" }, // new table being validated
  ];
}

A Function that returns more than one record must be the last Function in the connection's pipeline. If an earlier Function returns several records, processing aborts and no events reach the destination. Once the new table checks out, the first entry comes out of the array and the old table stops receiving data. More in the Functions docs.

Start capturing your data in 3 easy steps

01
Capture
As easy as adding a Google Analytics Tag. Capture events from your site, your app, and everywhere else your customers engage.
./index.html
<script 
 async
 src="https://data.yourcompany.com/p.js">
</script>
02
Store
Use a data warehouse for maximum autonomy and control. Share data with anyone in any team.
file_type_mysql
03
Discover
Unlimited flexibility to understand user behaviour, engagement and experience. Get and send trusted data everywhere it needs to go
--get signup page views in the last day
select * from events where
  context_page_path = '/signup' and
  timestamp > now() - interval '1 day'
Subscribe to the Jitsu newsletter
Occasional product updates when we ship something worth knowing about. No spam.