Made in Builder.io

Visual Copilot Livestream | Dec 6 @10am PST

Introducing Visual Copilot: Figma to code with AI

Builder.io and Figma
Talk to Us
Product
Developers
Talk to Us

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:


Looking to hire a third party to help with your project?

Submit a project request and our partnerships team will reach out to connect you with an Expert from our partner ecosystem.

Connect with us

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

Get the latest from Builder.io

Developer Newsletter

Latest tips, tricks, and news for frontend developers from our blog

Product Newsletter

Latest features and updates on the Builder.io platform

By submitting, you agree to our Privacy Policy

Product

Visual Copilot Beta

Visual Headless CMS

Integrations

What's New

Company

About

Careers

Developers

Builder for Developers

Documentation

Devtools

Try Builder Playground

OPEN SOURCE

Builder

Mitosis

Qwik

Partytown

Solutions

Ecommerce

Marketing Sites

Landing Pages

Mobile Apps

Multi-brand

Headless CMS

Product

Visual Copilot

Visual Copilot Beta

Visual Headless CMS

Integrations

What's New

Company

About

Careers

Developers

Builder for Developers

Documentation

Devtools

Try Builder Playground

OPEN SOURCE

Builder

Mitosis

Qwik

Partytown

Builder.io logo

Visually build and optimize digital experiences on any tech stack. No coding required, and developer approved.

Get Started

Log In

Product

Features

Pricing

Integrations

React.js

Next.js

Gatsby

Angular

Vue

Nuxt

Hydrogen

Salesforce

All Integrations

Use Cases

Product

Features

Pricing

Product

Visual Headless CMS

Integrations

What's New

Company

About

Careers

Developers

Builder for Developers

Developer Docs

Open Source Projects

Performance Insights

Developers

Builder for Developers

Documentation

Dev Tools

Try Builder Playground

Open Source

Builder

Mitosis

Qwik

Partytown

Resources

Documentation

Blog

Community Forum

Templates

Partners

Submit an Idea

Solutions

Ecommerce

Landing Pages

Multi-brand

Headless CMS

Popular Guides

SaaS Marketing Site Ebook

Composable Commerce Ebook

Headless CMS Guide

Landing Pages

Headless CMS

Headless Storefront

Customer Showcase

Customer Success Stories

Frameworks

React

Next.js

Qwik

Gatsby

Angular

Vue

Nuxt

Hydrogen

All Integrations

CMS

React

Integrations

React.js

Next.js

Gatsby

Angular

Vue

Nuxt

Hydrogen

Salesforce

All Integrations

Resources

Blog

Knowledge Base

Community Forum

Partners

Performance Insights

Templates

Success Stories

Showcase

Integrations

React.js

Next.js

Gatsby

Angular

Vue

Nuxt

Hydrogen

Salesforce

All Integrations

Resources

Blog

Knowledge Base

Community Forum

Partners


Templates

Success Stories

Showcase

Use Cases

Company

About

Careers

Resources

Blog

Knowledge Base

Community Forum

Partners

Performance Insights

Templates

Success Stories

Showcase

© 2023 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms