# Shopify SEO & Universal Cart for AI agents

Most Shopify themes ship incomplete `Product` structured data, duplicate `/collections/*/products/*` internal links and thin collection pages. Clone your theme with Shopify CLI, add clickd’s skills, and let your agent fix Liquid or Hydrogen templates and verify every product field live.

- Install skills: `npx skills add subinternal/clickd`
- Ask your agent: "Check our live Shopify product and collection pages with clickd_check (kind: "product") and clickd_brief, fix sections/main-product.liquid for Universal Cart, and verify live."
- MCP tools used: `clickd_check`, `clickd_brief`, `clickd_pages`, `clickd_rescan`

## What breaks most often on Shopify

- **Missing Universal Cart & variant schema** (`schema-fits`): Default themes often emit a single `Offer` instead of `ProductGroup` + `hasVariant` with SKU, GTIN, availability, shipping and return policy.
- **Collection-prefixed product links** (`canonical`): Linking to `/collections/summer/products/hat` instead of `/products/hat` splits internal link equity across duplicate product URLs.
- **Empty collection templates** (`answer-first`): Collection pages list product grids with no opening description, FAQ or `BreadcrumbList` structured data for category searches.

## The Shopify agentic SEO loop

1. **Check a live product URL** (`clickd_check`): Run clickd_check (kind: "product") on a multi-variant product URL to list every missing Merchant listing and Universal Cart field.
2. **Edit Liquid or Hydrogen** (`shop-ready`): Your agent updates `sections/main-product.liquid`, `snippets/card-product.liquid` and `layout/theme.liquid` using Shopify’s native `structured_data` or JSON-LD.
3. **Fix collection canonicals** (`site-architecture`): Update product grid links to point directly to `{{ product.url }}` rather than `{{ product.url | within: collection }}`.
4. **Push theme & rescan** (`clickd_rescan`): Deploy via GitHub integration or `shopify theme push`, then run clickd_check and clickd_rescan on the live store.

## Worked pattern (snippets/card-product.liquid)

Link directly to canonical /products/ URLs and emit variant-aware ProductGroup schema in main-product.liquid.

```
{%- comment -%} Avoid "| within: collection" so every internal link hits canonical /products/handle {%- endcomment -%}
<a href="{{ product.url }}" class="full-unstyled-link">
  {{ product.title | escape }}
</a>
```

## Prompts to run on Shopify

- **Universal Cart product audit**: "Run clickd_check (kind: "product") on 3 of our live Shopify product pages and fix every missing ProductGroup, Offer, shipping and return field in our Liquid theme."
- **Fix /collections/*/products/* links**: "Search our Shopify theme for "| within: collection" and replace collection-scoped product links with canonical {{ product.url }} links."
- **Upgrade collection templates**: "Audit our top 10 Shopify collection pages with clickd_pages and add concise buyer-focused descriptions, BreadcrumbList JSON-LD and internal links."

## Paired skills

- [Shop ready](https://clickd.com/skills/shop-ready): Fixes the Product data in a shop's own product templates so it states what the page shows, and checks each live page with clickd before and after.
- [Schema markup](https://clickd.com/skills/schema-markup): Generates, wires and validates JSON-LD structured data (Organization, LocalBusiness, Product, Service, Article, FAQPage and BreadcrumbList) from the visible facts on your pages, checked live with clickd.
- [Site architecture](https://clickd.com/skills/site-architecture): Audits and fixes your site’s internal link graph, orphan pages, topic hubs, crawl depth and BreadcrumbList schema in code, then verifies the updated structure on the live site with clickd.
- [On-page SEO](https://clickd.com/skills/on-page-seo): Rewrites title tags, meta descriptions, single H1s, question headings, answer-first openings, image alt text and AI writing tells in your site’s templates and content files, checked live with clickd.

## Questions

### Does this work on standard Liquid themes as well as Shopify Hydrogen?

Yes. The `shop-ready` skill ships worked reference patterns for both Shopify Liquid themes (edited locally via GitHub or `shopify theme pull`) and React-based Shopify Hydrogen storefronts.

### Will editing theme JSON-LD overwrite our Google Merchant Center feed?

No. Your Merchant Center feed stays untouched; fixing your storefront’s JSON-LD ensures Google’s crawler and Universal Cart see the exact same prices, variants, GTINs and availability on the page itself.
