Watch Webinar: Figma - Design to Code in 80% Less Time

Announcing Visual Copilot - Figma to production in half the time logo
Talk to Us
Talk to Us










Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required



Get StartedLogin

You can track custom events to evaluate your content's performance. For example, you can:

  • measure A/B test performance by custom events, such as add-to-cart rates or average order value
  • break down impressions and conversions by product views or orders
  • build completely custom dashboards associated with Builder content and sessions

You can track a custom event using JavaScript or with the Visual Editor's JS editor or within your own codebase. Custom events can have any name.

In Builder content or from the the custom JavaScript panel, track an event within an action binding:


Alternatively, you can track a custom event using JavaScript within your own codebase:

// Or, track an event within your project's code
import { builder } from '';

If you're using web components, such as Shopify hosted, you can access the global Builder instance from any script tag or function. Note that in this case, you might need to wrap the call in a setTimeout() to ensure BuilderWC is loaded:


To import the latest SDK, specify the framework as follows:

import { track } from ''

// Next.js, App Router
import { BuilderContent } from "";

// Qwik
import { getContent } from "";
import {
  type RegisteredComponent,
} from "";

//  React, Remix, Hydrogen, Gatsby
import { BuilderComponent, builder, useIsPreviewing } from "";
import { BuilderComponent, builder } from "";
import { BuilderComponent } from '';

// Vue
import { getContent, RenderContent, isPreviewing } from '';
import { getContent, RenderContent, isPreviewing } from '';

// Nuxt
import { RenderContent, getContent, isPreviewing } from ''

//  Svelte
import { RenderContent } from '';

//  Angular
import { BuilderModule } from '';

To display metrics for your custom events on the overview dashboard, take the following steps from the content entry where you use your custom event:

  1. Navigate to the Insights tab.
  2. Click on the three dots in the top right corner and choose Customize Metrics.
  3. Select Manage Custom Events.
  4. Add a new event to start tracking your custom event on the dashboard.

5. Enter the Event Name, matching the string supplied to builder.track().

6. Add a Display Name to label your custom metric on the dashboard.

7. Optionally add a Description for the event.

8. Click Submit and make sure the new event is checked to start tracking.

For more information, refer to Viewing Metrics with Insights.

With the Builder Gen 2 SDKs, you can use Builder's event tracking module to:

  • track events
  • track data retrieval
  • handle API requests

You can create event objects, check if tracking is enabled, and send the event data to a tracking API.

To track and send the event data to the tracking API, use the track() function with an object containing the type property.

The type property specifies the type of event you want to track. It can be one of the predefined values:

  • impression
  • conversion
  • click
  • some-custom-event.

You can choose the appropriate type based on the event you want to track. For example:

// Make sure you're using a Gen 2 SDK
import { track } from ''

  type: 'impression' | 'conversion' | 'click' | 'some-custom-event',
  apiKey: YOUR_API_KEY

enterprise plans

You can incorporate custom events into your custom dashboards by modifying your dashboards' SQL queries. For more information, see Programming Custom Dashboards.

Was this article helpful?


Visual CMS

Theme Studio for Shopify

Sign up


Featured Integrations





Get In Touch

Chat With Us




© 2020, Inc.


Privacy Policy

Terms of Service


Get the latest from

By submitting, you agree to our Privacy Policy