Use the label in custom themes and headless storefronts
Read the OmniBuzz label from a variant metafield in your own Liquid code or in the Storefront API, and apply the same show rule as the app block.
The app block covers most themes. If your theme does not support app blocks, or you build a headless storefront, you can read the finished label yourself. OmniBuzz writes it to a variant metafield, and the Liquid theme and the Storefront API can both read it.
Where the data lives
| Property | Value |
|---|---|
| Namespace | omnibuzz |
| Key | label |
| Type | json |
| Owner | Product variant |
| Storefront access | Public read |
| Definition name | OmniBuzz label |
OmniBuzz creates the definition for you. The value exists whenever the variant has OmniBuzz data. m can be empty ({}); then show nothing.
Theme block users: nothing changes. The Omnibus price block keeps using its own data ($app:omnibus). You only need this page if you write your own code.
The value format
{
"v": 1,
"u": "2026-11-05T02:10:00Z",
"w": 30,
"m": {
"123456789": {
"c": "EUR",
"p": 10000,
"r": 12000,
"pct": 16,
"t": {
"en": "Lowest price in the last 30 days: €120.00",
"de": "Niedrigster Preis der letzten 30 Tage: 120,00 €",
"fr": "Prix le plus bas des 30 derniers jours : 120,00 €"
},
"b": {
"en": "-16%",
"de": "-16 %",
"fr": "-16 %"
}
},
"987654321": {
"c": "SEK",
"p": 114500,
"r": 136000,
"pct": 15,
"fx": 200,
"t": {
"en": "Lowest price in the last 30 days: SEK 1,360.00",
"de": "Niedrigster Preis der letzten 30 Tage: 1.360,00 SEK",
"fr": "Prix le plus bas des 30 derniers jours : 1 360,00 SEK"
},
"b": {
"en": "-15%",
"de": "-15 %",
"fr": "-15 %"
}
}
}
}
The example shows three languages to keep it short. The real value has all ten in t and in b. The shop currency in the example is EUR, so the second market is a converted one and carries fx.
| Field | Meaning |
|---|---|
v | Format version. Currently 1. |
u | When the value was written (ISO time). |
w | Window length in days. |
m | Results by market. The key is the numeric market ID. Only markets with a label to show are present. It can be empty. |
c | Currency of the entry. |
p | Price when it was checked, in cents (the same unit as Liquid prices, also for currencies without decimals). |
r | The prior price, in cents. |
pct | Reduction from the prior price, in percent, rounded down. |
fx | Exchange-rate tolerance in basis points (200 = 2%). Present only when c is not the shop currency. |
t | Label text by language. All ten languages. |
b | Badge text by language. Present only when pct is above 0. |
The show rule
Always check the stored entry against the live page. Show the label only when all of these are true:
mhas an entry for the buyer’s market ID.cequals the buyer’s currency.- The variant’s compare-at price is above its price.
ris above 0.- The live price in cents equals
p. For an entry withfx, this also passes whenabs(price - p) * 10000 <= p * fx.
Pick the text in this order: the buyer’s language (for example de), then the base language (pt and pt-BR use pt-PT), then en. Show the badge only when the live price equals p exactly. Treat all text as plain text: in Liquid use | escape, in JavaScript use textContent, never innerHTML.
If one check fails, show nothing. Do not show an old label next to a changed price.
Liquid example
Save this as snippets/omnibuzz-label.liquid and render it on the product page:
{% doc %}
@param {variant} variant - The selected variant
@example
{% render 'omnibuzz-label', variant: product.selected_or_first_available_variant %}
{% enddoc %}
{%- liquid
assign label = variant.metafields.omnibuzz.label.value
assign market_id = localization.market.id | append: ''
assign entry = label.m[market_id]
assign price = variant.price
assign show = false
assign exact = false
if entry and entry.c == cart.currency.iso_code and variant.compare_at_price > price and entry.r > 0
if price == entry.p
assign show = true
assign exact = true
elsif entry.fx != blank
assign drift = price | minus: entry.p | abs | times: 10000
assign allowed = entry.p | times: entry.fx
if drift <= allowed
assign show = true
endif
endif
endif
if show
assign lang = request.locale.iso_code
assign base = lang | split: '-' | first
if base == 'pt'
assign base = 'pt-PT'
endif
assign text = entry.t[lang] | default: entry.t[base] | default: entry.t.en
assign badge = entry.b[lang] | default: entry.b[base] | default: entry.b.en
endif
-%}
{%- if show and text != blank -%}
<p class="omnibuzz-label">{{ text | escape }}</p>
{%- if exact and badge != blank -%}
<span class="omnibuzz-badge">{{ badge | escape }}</span>
{%- endif -%}
{%- endif -%}
The snippet reads the live price from the variant. When a shopper picks another variant, your theme has to render the snippet again or run the same checks in script.
Storefront API example
Without @inContext, the API returns prices of the primary market. Always pass the buyer’s country and language:
query OmniBuzzLabel($handle: String!, $country: CountryCode!, $language: LanguageCode!)
@inContext(country: $country, language: $language) {
localization {
market {
id
}
}
product(handle: $handle) {
variants(first: 50) {
nodes {
id
price {
amount
currencyCode
}
compareAtPrice {
amount
currencyCode
}
metafield(namespace: "omnibuzz", key: "label") {
value
}
}
}
}
}
value is a JSON string. Parse it, then apply the show rule:
- Convert
amountto cents:Math.round(Number(amount) * 100). Do this for every currency. - The market ID is a global ID such as
gid://shopify/Market/123456789. Use the number at the end as the key inm. localization.marketis deprecated from Storefront API 2026-10, but it still works. Without a market ID, show nothing.
Good to know
- The values are updated every night and again when you change label texts or the exchange-rate tolerance on the Labels page.
- The app formats the money in the text itself. It can differ slightly from your shop’s money format.
- A market with labels turned off, or a variant without a result, has no entry. Show nothing then.
When you uninstall the app
Shopify removes only data that belongs to the app itself. The omnibuzz definition and its values stay in your store after you uninstall. The app can no longer clean them up. To remove them, open Settings > Custom data > Product variants in your Shopify admin and delete the OmniBuzz label definition. Deleting it also deletes its values.
Remove your code too. After you uninstall, the data stops updating, and an old label could sit next to a changed price. Remove your snippet or query when you uninstall.