On this page
Why internal metadata appears in the cart drawer
A fulfillment routing marker belongs to an individual line when it describes that item. A cart-wide campaign reference belongs to the cart. A theme that prints every line property will still display internal line markers unless its rendering logic filters them.
Implement the distinction
For an Ajax theme, attach a line marker through the properties object in cart/add.js. Set a cart-wide attribute through cart/update.js. Use locale-aware routes rather than hardcoding the root path.
fetch(window.Shopify.routes.root + 'cart/update.js', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({attributes: {__campaign_ref: 'spring'}})
});
For line properties, filter keys beginning with an underscore in each theme surface that renders them. Keep customer-facing personalization visible and escape output.
{% for property in item.properties %}
{% assign prefix = property.first | slice: 0 %}
{% unless prefix == '_' or property.last == blank %}
{{ property.first | escape }}: {{ property.last | escape }}
{% endunless %}
{% endfor %}
Inspect the cart page, drawer, quick-add and third-party cart widgets independently. Do not assume editing one Liquid snippet fixes all surfaces. Both types of private metadata can be visible in order administration.
- Add a disposable item with public personalization and a private line marker.
- Inspect cart JSON and confirm the line marker is present but not rendered in the drawer.
- Set a private cart attribute and verify it is absent from Ajax cart reads.
- Test the cart page and checkout, then place a test order and inspect order details.
- Confirm server-side rules reject manipulated metadata and that customer personalization remains visible.

