Skip to content
Garanify

Custom shop Snippet

GARAN rules in a custom shop

Last updated 18 November 2026

In short

Rules give every matching product a producer guarantee in years. In the snippet they live in the JSON configuration, inline on the page or as a file via data-config-url. Conditions are vendor, tag and category. The first matching rule applies.

Rules in the configuration

<script type="application/json" id="gfy-config">
{ "rules": [
  { "match": { "vendor": "Miele" }, "years": 10 },
  { "match": { "category": "Cordless drills" }, "years": 5 }
] }
</script>
  • vendor compares with the brand from JSON-LD.
  • The first matching rule applies. Put specific rules first.
  • A placeholder with data-years wins over every rule.

Configuration as a file

Instead of inline you can load the configuration as a file: data-config-url="https://your-shop.example/garanify.json". The server must allow CORS. Inline wins over the file.

Related questions

Which rule applies if two match?

The first in the list.

Do I need to reload the page after changing the configuration?

Yes. In single-page shops, window.Garanify.rescan() checks the page again.

Can I create rules by price?

No. Conditions are vendor, tag and category.

Was this article helpful?

What was missing? Send us a short note and we will add it to the article. Send feedback by email