New guide: AI is in production. Is your governance?

Announcing Visual Copilot - Figma to production in half the time

Builder.io
Builder.io
Contact sales

New guide: AI is in production. Is your governance?

Announcing Visual Copilot - Figma to production in half the time

Capture valuable data about user interactions with content and pass that data to an analytics provider like a Customer Data Platform (CDP). In this way, you can gain insights, build targeted segments, and personalize future content based on user behavior.

To track when a piece of Builder content loads and a user interacts with it, access the content object. This object stores the information returned from Builder for display in your application.

Use the contentLoaded callback on the BuilderComponent:

import { BuilderComponent } from '@builder.io/react'

<BuilderComponent 
  model="page"
  contentLoaded={(data, content) => {
    amplitude.track('builderImpression', {
      contentId: content.id,
      contentName: content.name,
      testVariationId: content.testVariationId,
      // Make sure to edit the variant name in Builder with a descriptive name
      testVariationName: content.testVariationName
    });
  }}
/>

Here's what's happening:

  1. The BuilderComponent from the @builder.io/react package renders a piece of Builder content.
  2. The model is specified as "page". This could be any model type in the Builder Space.
  3. The contentLoaded callback triggers when the Builder content finishes loading.
  4. Inside the callback, Amplitude's track method is used to log an event called 'builderImpression'. Replace this with the tracking method from the CDP of choice.
  5. Several pieces of data about the content are passed as event properties:
  • contentId: the unique ID of the content.
  • contentName: the name given to the content in Builder.
  • testVariationId: if this content is part of an A/B test, the ID of the specific test variation.
  • testVariationName: a human-readable name for the test variation (make sure to set this in Builder).

With this in place, every time a piece of Builder content loads, it is logged to the CDP with metadata such as content ID, name, and test variation details.

Use this data in the CDP to:

  • Analyze content performance by measuring metrics like impressions, clicks, and conversions.
  • Define user segments based on the specific content pieces they have viewed.
  • Personalize future content experiences based on user past viewing behavior.

Tip: You can use Builder's smart targeting in conjunction with a an analytics provider to automatically capture and target audiences based on their behavior. To learn more, visit Smart Targeting and Using Builder with Customer Data Platforms.

The exact capabilities will depend on the features and integrations offered by the chosen CDP.

Once data is sent to your analytics provider, use it to:

  • Analyze content performance by measuring engagement and conversion metrics.
  • Create user segments based on the content they have viewed for targeted campaigns.
  • Implement content recommendations based on user viewing history.

These are just a few examples, but the specific use cases will depend on the capabilities of the chosen analytics provider and your business requirements.

For more ways to leverage your analytics provider with Builder, read Smart Targeting.

Was this article helpful?