Made in

Join us for the biggest Figma-to-code launch of the year 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 target content based on user interactions with your e-commerce platform's resources—such as products or collections—with e-commerce plugins.

To use e-commerce resource targeting, your app must pass the appropriate targeting attributes to Builder. For example, if you target an announcement bar to display when a user adds a certain item to their cart, your app must pass the product's id when requesting the announcement bar's content.

You can pass targeting attributes either by using the JavaScript SDK or with query string parameters when requesting content using the Builder Content API and GraphQL API.

The e-commerce custom type that you use for your targeting condition determines which targeting attribute you use. For example, when using a request object type like ShopifyProduct—displayed in the custom types list as Shopify Product when creating a new targeting condition—you must pass the Shopify ID for your product to the product attribute.

You can implement the above with the following code when using the SDK:

const content = await builder.get('myTargetedContent', {
  userAttributes: { product: }

You can alternatively use setUserAttributes to set the targeting attributes once across multiple content requests:

builder.setUserAttributes({ product: });

const content = await builder.get('myTargetedContent').promise();
const otherContent = await builder.get('myOtherTargetedContent').promise();

You can also pass the targeting attributes using query strings when you send requests with the content or GraphQL APIs:

const response = await fetch(`${}`)

If matches the ID of the product selected for your targeting condition, then your content renders.

After setting up your codebase to pass targeting attributes to Builder, you can target content using e-commerce targeting conditions. For example, you can show users an announcement bar when a certain product is in the cart.

To learn how to set up targeting within the Visual Editor, see Targeting with e-commerce plugins.

For more information on how to use e-commerce plugins, check out the following articles:

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?


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


Developer Newsletter

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

Product Newsletter

Latest features and updates on the platform

By submitting, you agree to our Privacy Policy