Product tagger
Apps/Recipes/Product tagger

Tag Shopify products automatically

The merchant writes rules on the admin page ("products that mention merino get the tag Wool"); every product created or changed gets its rules' tags, and Tag every product applies them to the whole catalog.

Shopify, customScopes read_productswrite_productsRecipe id tagger

What you'll build

Rules pagekeyword → tagWebhookproducts/create · updatetagProducta jobShopifytagsAdd, missing tags only

What it shows: Webhook triggers, a long job split into pages, and work that's safe to repeat under Shopify's rate limits.

Before you start

  • The CLI: npm i -g @inferencebureau/apps, then ib-apps login once.
  • A Shopify Partner organization, and a development store to install on.

Create the app from the recipe

One command creates the app on Inference Bureau and downloads its files into ./my-tagger. Shopify recipes need --platform shopify.

ib-apps create my-tagger --platform shopify --recipe tagger

Tour what the recipe loaded

The recipe lies over the Shopify starter: files of the same path are replaced, and the starter's storefront block is dropped. Here's where each piece lives.

WhereWhat's there
api/models/tagRule/The tagRule model: keyword, tag, on or off, and a unique key per store.
settings.ib.ts, api/actions/tagProduct.tsproducts/create and products/update queue tagProduct with only the fields it reads (includeFields).
api/lib/tagger.tsA rule matches whole words in the title, description, vendor or type. Only missing tags are added, with one tagsAdd; when none are missing nothing is called, which stops the products/update the tagging itself causes.
api/actions/retagAll.tsTags 50 products per job and queues the next page with its cursor, under one concurrencyKey per store. A page still throttled after retries throws and is tried again.
web/app/rules.tsx, web/app/api/The rules page; every route checks the session token and uses session.api.
tests/tagger.test.tsRule matching, missing tags only, and the paged retag, with the Admin API mocked.
export const settings: AppSettings = {
  type: "ib/settings/v1",
  platform: "shopify",
  webhooks: [
    { topic: "products/create", action: "tagProduct", includeFields: ["admin_graphql_api_id", "title", "body_html", "vendor", "product_type", "tags"] },
    { topic: "products/update", action: "tagProduct", includeFields: ["admin_graphql_api_id", "title", "body_html", "vendor", "product_type", "tags"] },
  ],
};

Check what it set on the app

Nothing to do here: this is what the recipe configured, so you know where to look in Settings later.

PlatformShopify, custom
Scopesread_products, write_products
Admin pagesInference Bureau
Webhooksproducts/create, products/update → tagProduct

Connect Shopify and install

  1. Create the Shopify app in your Partner organization
  2. Install on a development store
  3. Write a rule in the admin and change a product: Logs show tagProduct

Run it

ib-apps dev syncs both ways while you work and runs the development server. Saving anything under extensions/ releases it to the development Shopify app by itself.

cd my-tagger
ib-apps dev

Logs show a succeeded config release once the extension is live.

Try it end to end

0 of 4 checked

Make it yours

Match differently

Matching is in api/lib/tagger.ts; run ib-apps test after.

React to more

Add topics to webhooks in settings.ib.ts; see Webhooks.

Ship it

ib-apps test runs its tests, then ib-apps deploy sends development to production. See Deploys.