Watch our biggest AI launch event

Announcing Visual Copilot - Figma to production in half the time

Builder.io logo
Contact Sales
Platform
Developers
Contact Sales

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

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

Resources

Blog

Get StartedLogin

Customer Data Platforms (CDP) help you track and identify user characteristics and group them into Traits, Personas, and Audiences.

Within Builder, you can use these CDP groups as custom targeting attributes for robust personalization.

You can personalize Builder content based on various attributes. For example, to target content based on the current user audience type, define a custom targeting attribute for audience:

  1. Go to Account Settings.
  2. Click the Pencil icon next to Custom Targeting Attributes.
  3. Click +New Target Attribute
  4. Enter a name such as audience for Name.
  5. Leave String as the Type.
  6. Click Save.

Next, from your codebase, fetch the current user audience type and set it using Builder's SDK:

builder.get('your-model', {
// Before the Builder content is fetched, set up segment
// alternatively, Builder also accepts the targeting 
// attribute as a query param for direct API calls
 const audienceSegment = await myCustomCDP.identify({ user: currentUser.id })
 
// fetch corresponding content to the targeted audience
 builder.setUserAttribute({ audience: audienceSegment.name })

Now that you have set up your host to send the user's audience type, you can target content specifically to any of the audience types defined in your CDP.

Additionally, tracking events enables your CDP to automatically assign the audience type to your current users based on their interactions with your content:

 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
     })
   }
 />
 

Traditionally, creating personalized content for specific audience types, such as VIPs, followers, or casual users required implementing numerous if-else statements in the code, leading to complex and difficult-to-maintain logic.

Customer Data Platforms (CDPs) help solve this issue by providing advanced machine learning algorithms or rule-based systems to categorize users into different traits, personas, or audiences based on their characteristics and interactions. For instance, CDPs can mark users as followers if they subscribe to a newsletter, or as VIPs if they have made significant purchases.

To use a CDP's audience categorization in Builder, developers need to consult the CDP by passing the current user ID (or anonymous ID) to the CDP's API endpoint for user categorizing. The CDP then provides information about the user's traits, behaviors, and interactions, which can help determine the appropriate audience type.

Once the audience type is identified by the CDP, it should be passed down as a user attribute to Builder, by using the setUserAttribute() function provided by Builder's SDK, as shown in the code snippet above. Then you can use the audience attribute for custom targeting in Builder, enabling content personalization based on the user's audience type.

Moreover, CDPs offer flexibility in defining various attributes for targeting, such as "big spender" or other custom traits. This helps developers target content based on a wide range of user characteristics, which ensures more granular and effective personalization.

For more information on targeting in Builder, refer to:

For more detail on using Builder with an analytics provider, such as a CDP, visit Passing Data to an Analytics Provider.

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Newsletter

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

Product

Platform Overview

Integrations

What's New

Open Source

Builder

Builder

Mitosis

Mitosis

Qwik

Qwik

Partytown

Partytown

Popular Guides

From Design to Code Guide

Composable Commerce Guide

Headless CMS Guide

Headless Commerce Guide

Composable DXP Guide

Design to Code

Resources

Blog

Knowledge Base

Community Forum

Partners

Templates

Success Stories

Showcase

Resource Center

Frameworks

React

React

Next

Next.js

Qwik

Qwik

Gatsby

Gatsby

Angular

Angular

Vue

Vue

Svelte

Svelte

Remix logo

Remix

Nuxt

Nuxt

Hydrogen

Hydrogen

See All

© 2024 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Security & Compliance

Cookie Preferences