{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Engage Studio","type":"markdown"},"seo":{"title":"Personalize Message Content — In-Browser Messaging","description":"Reference guide for personalizing In-Browser Message content using Profile Variables and Liquid template syntax in Engage Studio, including supported constructs and examples.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"personalize-message-content","__idx":0},"children":["Personalize Message Content"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In-Browser Message campaigns support dynamic content personalization using ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Profile Variables"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Liquid template syntax"]},". Variables are resolved at runtime by RT Personalization 2.0 and rendered by the TD Web SDK before the message is displayed in the browser."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"variable-sources","__idx":1},"children":["Variable Sources"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Profile variables available in In-Browser Messages come from four sources, all derived from the campaign's linked ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parent Segment"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Source"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source"]}," "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Prefix"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Prefix"]}," "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"Description"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}," "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Batch Attributes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.imported.*"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User profile attributes computed from batch processing and imported into RT 2.0 as External (EXT) attributes — loyalty tier, lifetime value, name, and similar. Accessed via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.imported.*"]}," in Liquid syntax (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.imported.loyalty_tier"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT Single Attributes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.single.*"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Scalar values updated in real time based on streaming events — most recent product viewed, current session data, and similar."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT List Attributes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.list.*"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Array values updated in real time — cart items, browsing history, and similar."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT Counter Attributes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.counter.*"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Numeric counters updated in real time — visit count, purchase count, and similar."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Event fields are not yet supported"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Referencing fields from the triggering event (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["product_id"]}," from a page view) in Liquid template content is not supported."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"basic-variable-output","__idx":2},"children":["Basic Variable Output"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use double curly braces to output a variable value directly into content:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"<p>Welcome back, {{rt_profile.imported.first_name}}!</p>\n<p>Your current tier: {{rt_profile.imported.loyalty_tier}}</p>\n<p>Most recent product viewed: {{rt_profile.single.most_recent_product}}</p>\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Variable output is HTML-escaped"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{ variable }}"]}," output is automatically HTML-escaped by RT 2.0 before it is delivered to the browser. Characters such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[">"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\""]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]}," in attribute values are escaped, so user-controlled fields do not produce XSS even though the Liquid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["escape"]}," filter is not supported."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"liquid-template-syntax","__idx":3},"children":["Liquid Template Syntax"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In-Browser Messages support a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["limited subset"]}," of Liquid template syntax. Templates are translated by Realtime API into Reactor-compatible JavaScript expressions at configuration time, then evaluated at runtime on each personalization request."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"supported-constructs","__idx":4},"children":["Supported Constructs"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Construct"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Construct"]}," "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"10%","data-label":"Supported"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Supported"]}," "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"60%","data-label":"Notes"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Notes"]}," "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% if %} / {% elsif %} / {% else %} / {% endif %}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No nesting depth limit."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% for item in collection %} / {% endfor %}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Maximum 3 nesting levels overall."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{ variable }}"]}," output"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.*"]}," prefixes (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.imported.*"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.single.*"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["=="]}," , ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["!="]}," comparison"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String and null comparisons."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["and"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["or"]}," logical operators"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Combining multiple conditions."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% assign %}"]}," variable assignment"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{ value \\| filter }}"]}," filters"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["upcase"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["downcase"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["truncate"]},", etc. are not supported."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% unless %}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% if condition == false %}"]}," as a workaround."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% case %} / {% when %}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use chained ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% if %} / {% elsif %}"]}," as a workaround."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contains"]}," operator"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not supported in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% if %}"]}," conditions."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["forloop.index"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["❌"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Loop metadata and parameters are not supported."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"variable-syntax-reference","__idx":5},"children":["Variable Syntax Reference"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Liquid Syntax"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Liquid Syntax"]}," "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Attribute Type"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Attribute Type"]}," "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{rt_profile.imported.attribute_name}}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Batch attribute (accessed via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rt_profile.imported.*"]}," in In-Browser Messaging)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{rt_profile.single.attribute_id}}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT single attribute"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{rt_profile.list.attribute_id.sub_attribute}}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT list attribute sub-field"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{rt_profile.counter.attribute_id.total}}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RT counter attribute total"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":6},"children":["Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"conditional-content-by-loyalty-tier","__idx":7},"children":["Conditional Content by Loyalty Tier"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"{% if rt_profile.imported.tier == \"gold\" %}\n  <p>20% off for Gold members!</p>\n{% elsif rt_profile.imported.tier == \"silver\" %}\n  <p>10% off for Silver members!</p>\n{% else %}\n  <p>Sign up today for exclusive deals!</p>\n{% endif %}\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"loop-over-cart-items","__idx":8},"children":["Loop Over Cart Items"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"{% if rt_profile.list.cart_items.item_list != null %}\n  <h2>Your Cart</h2>\n  <ul>\n    {% for item in rt_profile.list.cart_items.item_list %}\n      <li>{{ item }}</li>\n    {% endfor %}\n  </ul>\n{% endif %}\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"nested-conditional-and-loop","__idx":9},"children":["Nested Conditional and Loop"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"html","header":{"controls":{"copy":{}}},"source":"{% if rt_profile.single.most_recent_product %}\n  <p>You recently viewed <strong>{{ rt_profile.single.most_recent_product }}</strong>.</p>\n  {% if rt_profile.list.recommendations.product_ids != null %}\n    <ul>\n      {% for product in rt_profile.list.recommendations.product_ids %}\n        {% if product != rt_profile.single.most_recent_product %}\n          <li>{{ product }}</li>\n        {% endif %}\n      {% endfor %}\n    </ul>\n  {% endif %}\n{% endif %}\n","lang":"html"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":10},"children":["Limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unsupported Liquid filters"]},": String manipulation filters (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["upcase"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["downcase"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["replace"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["truncate"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["split"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["join"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["date"]},", etc.) are not available. Pre-process values as batch attributes if transformation is needed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No variable assignment"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% assign %}"]}," is not supported. Use the attribute system in Audience Studio to derive computed values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["For loop nesting"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% for %}"]}," loops support a maximum nesting depth of 3 levels."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% unless %}"]}]},": Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{% if condition == false %}"]}," instead."]}]}]},"headings":[{"value":"Personalize Message Content","id":"personalize-message-content","depth":1},{"value":"Variable Sources","id":"variable-sources","depth":2},{"value":"Basic Variable Output","id":"basic-variable-output","depth":2},{"value":"Liquid Template Syntax","id":"liquid-template-syntax","depth":2},{"value":"Supported Constructs","id":"supported-constructs","depth":3},{"value":"Variable Syntax Reference","id":"variable-syntax-reference","depth":3},{"value":"Examples","id":"examples","depth":2},{"value":"Conditional Content by Loyalty Tier","id":"conditional-content-by-loyalty-tier","depth":3},{"value":"Loop Over Cart Items","id":"loop-over-cart-items","depth":3},{"value":"Nested Conditional and Loop","id":"nested-conditional-and-loop","depth":3},{"value":"Limitations","id":"limitations","depth":2}],"frontmatter":{"seo":{"title":"Personalize Message Content — In-Browser Messaging","description":"Reference guide for personalizing In-Browser Message content using Profile Variables and Liquid template syntax in Engage Studio, including supported constructs and examples."}},"lastModified":"2026-07-13T05:57:20.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/marketing-cloud/engage-studio/experiences/personalize-message-content","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}