7/24 | Livestream: Training AI on your design system

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io
Contact sales

7/24 | Livestream: Training AI on your design system

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io

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

enterprise plans

This document serves as a quick reference for fetching content entries by targeting attributes.

  • Query Pages, Sections, and Data models by targeting attributes.

Before querying by targeting attributes, you must apply targeting attributes to a content entry. For more on this topic, see:

Tip: For Pages and Sections, the urlPath is also a targeting attribute. When requesting content entries by target attributes, do not forget to include urlPath if necessary.

When you create custom targeting attributes, you can specify the attribute you need as well as specify the type. Targeting attributes should be included as key-value pairs within the userAttributes option object.

The following list includes some common examples.

By default, content entries have access to targeting by device.

Request Desktop Version

Request Mobile Version

To target by authentication, go to your Space Settings and create a new custom targeting attribute with a value type of boolean. Reference the attribute within your code and pass in the appropriate boolean value.

Is Logged In

Instead of passing a literal value such as true, consider passing a variable or function to the request, such as getAuthenticationStatus().

To target by a custom, multi-faceted list of values, go to your Space Settings and create a new custom targeting attribute with a value type string. Toggle the Enum option and add options for your custom targeting attribute.

For example, an attribute of audience could have values such as recent-shopper, mens-fashion, and womens-fashion.

Reference the attribute within your code and pass in the appropriate one or more strings.

Single Value

Multiple Values

Providing multiple values to a custom target attribute will return the most inclusive content set of entries matching the values.

For example, imagine you have three content entries with an audience target. These entries have the following values:

  1. recent-shopper and womens-fashion
  2. mens-fashion
  3. recent-shopper and mens-fashion

A request for recent-shopper and womens-fashion would return the first and third entries.

For more information on targeting and custom attributes, see the following documentation:

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

By submitting, you agree to our Privacy Policy

  • Fusion

  • Publish

  • Product Updates

  • Figma to Code Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

© 2025 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

Gartner Cool Vendor 2024