Skip to content
trakoo
Esc
navigateopen⌘Jpreview
On this page

Bento

Route identified user lifecycle events to Bento for email marketing and automation.

Bento is an email marketing and automation platform with built-in event tracking, so behavior in your app can trigger campaigns and segment your audience.

When to use it

Bento is built around identified users and their email addresses. Reach for it when analytics events should feed email:

  • Trigger campaigns from user behavior — onboarding, re-engagement, upgrade nudges.
  • Segment contacts by feature usage and lifecycle stage.
  • Track what a user does after they sign up.

It is not a general-purpose analytics tool. Avoid Bento for:

  • Anonymous page views — the SDK requires an email for every event.
  • High-volume, unidentified event streams.
  • Real-time dashboards.

Pair Bento with a web-analytics provider such as PostHog or Pirsch, and route only identified events to Bento.

Installation

The client provider loads the Bento script from the CDN, so no package is needed in the browser. The server provider uses the Bento Node SDK.

# Server-side only
pnpm install @bentonow/bento-node-sdk

Client-side usage

Route Bento to identify and track, and let PostHog cover page views and anonymous traffic. exclude: ['pageView'] does the same job if you prefer to name the method you are dropping.

import { createClientAnalytics } from 'trakoo/client';
import {
  BentoClientProvider,
  PostHogClientProvider
} from 'trakoo/providers/client';

const analytics = createClientAnalytics({
  providers: [
    new PostHogClientProvider({ token: import.meta.env.VITE_POSTHOG_KEY }),
    {
      provider: new BentoClientProvider({
        siteUuid: import.meta.env.VITE_BENTO_SITE_UUID
      }),
      methods: ['identify', 'track']
    }
  ]
});

await analytics.initialize();

Server-side usage

The same routing applies on the server. Here Pirsch handles page views while Bento receives identified events only.

import { createServerAnalytics } from 'trakoo/server';
import {
  BentoServerProvider,
  PirschServerProvider
} from 'trakoo/providers/server';

const serverAnalytics = createServerAnalytics({
  providers: [
    new PirschServerProvider({
      hostname: 'example.com',
      clientSecret: process.env.PIRSCH_ACCESS_KEY!
    }),
    {
      provider: new BentoServerProvider({
        siteUuid: process.env.BENTO_SITE_UUID!,
        authentication: {
          publishableKey: process.env.BENTO_PUBLISHABLE_KEY!,
          secretKey: process.env.BENTO_SECRET_KEY!
        }
      }),
      exclude: ['pageView']
    }
  ]
});

Configuration

BentoClientProvider:

PropType
siteUuidstring

Your Bento site UUID, used to load the tracking script.

Typestring

BentoServerProvider:

PropType
siteUuidstring

Your Bento site UUID.

Typestring
authentication.publishableKeystring

Bento publishable key.

Typestring
authentication.secretKeystring

Bento secret key. Keep it server-side only.

Typestring

Delivery behavior

  • Bento batches events, so they can take one to three minutes to appear.
  • User context comes from your identify() call, so always identify with a valid email before tracking events.

Resources

Was this page helpful?