跳到正文
DEV Community· StorePolicyCheck·· 14 小時前AI 評分43

StorePolicyCheck 如何構建零誤報的 Shopify ProductGroup JSON-LD、插件指紋及 500x500 GMC 圖片驗證器,並開源 MCP Server

How We Built a Zero-False-Positive Shopify ProductGroup JSON-LD, Plugin Fingerprint & 500x500 GMC Image Verifier (+ Open-Source MCP Server)

AI 導讀

StorePolicyCheck 為公開的美國/美元 Shopify 網店構建唯讀驗證器,並開源免憑證 MCP Server,讓 Claude Desktop、Cursor 及 AI agents 呼叫 4 項唯讀診斷工具。

正文

Most Shopify Google Merchant Center (GMC) "Misrepresentation" checkers either install an invasive Shopify Admin OAuth app or run shallow regex checks that drown healthy stores in false positives.

When we built StorePolicyCheck — a 100% read-only verifier for public US/USD Shopify storefronts — we ran into four surprisingly subtle HTML & structured-data engineering traps that break naive parsers:

1. Why Cheerio .text() Glues Emails Into Adjacent Sentences

On real Shopify policy pages (<p>Contact hello@brand.com</p><p>Phone: 555-0199</p>), calling .text() directly concatenates adjacent block tags into hello@brand.comPhone, corrupting email domain verification.

  • Fix: Normalize block-level tags (p, div, li, br, td, h1–h6) with explicit whitespace boundaries before extracting mailto: and plaintext emails, and guard against trailing sentence-period run-ons like hello@brand.com.Our.

2. Why Multi-Pack ProductGroup.hasVariant Schemas Trigger False Price Mismatches

Modern Shopify themes emit nested ProductGroup.hasVariant JSON-LD arrays (for example, Single Unit $10 + 4-Pack $35). Naive parsers read the last Offer in the array and falsely flag $35 != $10 on the active single-unit ?variant= URL.

  • Fix: Aggregate all candidate Offer nodes across ProductGroup and Product blocks, resolve the active ?variant= ID explicitly, and verify both price and priceCurrency === "USD".
  • Free read-only tester: Shopify Variant JSON-LD Price Checker

3. Fingerprinting 8 Shopify App Families That Break GMC Parity Silently

Bundle apps (Kaching Bundles, WideBundle, Vitals), subscription widgets (Recharge, Seal Subscriptions, Appstle), auto-currency switchers (Transcy, Weglot), and page builders (PageFly, GemPages) frequently modify the visible buy-box price without updating raw JSON-LD. Fingerprinting their public script/DOM signatures lets merchants see which exact app caused the mismatch before clicking GMC "Request Review".

4. Sweeping 250 SKUs for Google's January 31, 2027 500×500 px Image Rule

Google Merchant Center enforces a 500×500 px minimum product image size starting January 31, 2027. Public Shopify stores expose image width & height metadata cleanly via /products.json?limit=250, allowing a 5-second read-only CSV audit with zero API tokens: Free 500×500 Image Checker.

Open-Source Zero-Credential MCP Server (Claude Desktop / Cursor)

Unlike Shopify Admin MCP bridges that require private API tokens, we open-sourced a zero-dependency Node.js MCP server (storepolicycheck-mcp) that lets Claude Desktop, Cursor, or AI agents invoke all 4 read-only diagnostic tools against public storefronts:

{
  "mcpServers": {
    "storepolicycheck": {
      "command": "node",
      "args": ["/path/to/storepolicycheck-mcp/index.mjs"]
    }
  }
}

(Disclosure: I built StorePolicyCheck. It is an independent read-only verification tool not affiliated with Google LLC or Shopify Inc.)

來源:DEV Community · dev.to