Is there a (recommended) way to add personalized content to a page?

I’ve been wondering about whether it’s possible to allow people building pages in Builder to refer to user-specific data. For example, for them to add some content to the page like “Hello Username”, where username varies for different logged-in users on our site.

For context, we mainly use Builder’s Pages feature, which we fetch the content for server side, and then return the HTML of this in our page responses.

I feel like Custom Targeting Attributes might be able to be used for this, but I’m not 100% sure. There is a key query param of the URL that seems like it could be for that

userAttributes.product=${product.id}

Are there other or recommended ways to try to do this?

Hi @jballo!

Custom Targeting Attributes seem like a very good option for your use case. Using Builder’s built-in types, custom targeting attributes offer a straightforward way to allow your team to specify arbitrary targeting conditions[in your case username] using strings and booleans.

You can certainly target something like userAttributes.username=${username} and update the welcome message based on the username.

You can also find help at Creating Dynamic URLs with Advanced Data Fetching

Let us know if you have any further questions or concerns. Thank you!

Hi Manish,

The roadblock I ran into is, I don’t see how to use a user Attribute to populate an element’s text or anything.

Is there a way to do that?

Hi @jballo!

You can bind any state to a text or other input using the state keyword, for example, if you have state.color = "#000" then you can bind a background or text with state value by just binding it to state.color

You can find more help at Connecting dynamic data in Builder’s Visual Editor

Let us know if you have any further questions. Thank you!