AITSEOAITSEO Docs
集成

Shopify 集成

OAuth 直连 Shopify 店铺,自动发布博客文章、产品描述、落地页。Meta 字段通过 Shopify Metafields API 写入。

Shopify 集成不需要安装任何插件——AITSEO 直接通过 Shopify OAuth 连接你的店铺。

连接步骤

1 · 启动授权流程

在 AITSEO 仪表盘进入 平台集成 → Shopify → 添加店铺

  • 填写你的 myshopify 域名your-store.myshopify.com
  • 点击「Connect Shopify

2 · Shopify OAuth 授权页

浏览器会跳转到 Shopify 官方授权页,显示:

AITSEO is requesting access to:
  ✓ Read products, collections, blog posts, pages
  ✓ Write blog posts, pages, product descriptions
  ✓ Read and write metafields (for SEO data)
  ✓ Read shop information

点击「Install app」。

3 · 跳回 AITSEO

授权完成后自动跳回 AITSEO,店铺会出现在「已连接」列表里。

首次连接会自动同步:

  • 所有已有的 Blog(Shopify 默认只有一个叫 "News",你可以在 Shopify 后台创建更多)
  • 产品分类(Collections)
  • 现有产品列表(用于后续同步产品 SEO 描述)

发布到 Shopify

博客文章

  • 在 AITSEO 里生成文章 → 发布时选 Shopify → 选择要发到哪个 Blog
  • AITSEO 会创建 Shopify Article(不是 Page)
  • 自动写入 title, body_html, tags, author, published_at

Meta 字段

Shopify 的 SEO 设置通过 Metafields 写入:

Metafield namespace.key写入内容
global.title_tagMeta Title
global.description_tagMeta Description
custom.seo.focus_keywordFocus Keyword
custom.seo.og_imageOpen Graph 图片 URL

注意global.* 是 Shopify 官方字段,主题模板一般都会读取。custom.* 是 AITSEO 的自定义字段,需要主题配合渲染才能生效。

Schema 注入

Shopify 主题大多在 theme.liquid 里有 <head> 区域。Schema JSON-LD 的注入有两种方式:

  1. 自动(通过 Shopify App Extension):AITSEO 在店铺 /apps/aitseo 路径挂一个 Script Tag 钩子,自动注入。适合默认 Shopify 2.0 主题。
  2. 手动(复制 snippet):AITSEO 给你一段 {% render 'aitseo-schema' %} Liquid 代码,你粘贴到主题的 theme.liquid <head> 区域。

产品描述自动化

AITSEO 不只是博客工具,也可以批量写产品描述

  1. 产品 → 批量优化 里导入要优化的 Product IDs

  2. AI 根据产品名、分类、已有属性生成:

    • 新的产品描述body_html
    • SEO Titleglobal.title_tag
    • Meta Descriptionglobal.description_tag
    • Alt text 给已有图片
  3. 你审阅后批量推送到 Shopify,支持 dry-run 预览。

落地页(Pages)

除了 Blog 和 Product,AITSEO 还能创建 Shopify Pages

  • 用于营销落地页、关于我们、政策页等
  • 支持 Gutenberg 风格的区块编辑(在 AITSEO 里)
  • 发布后映射为 Shopify Page,保留 Liquid 模板选择

速率限制

Shopify 的 REST Admin API 有速率限制(40 req/sec for partner plans, 80 req/sec for Plus)。AITSEO 内置速率限制器:

  • 批量发布 30 篇文章 → 约需 2-3 分钟
  • 批量更新 1000 个产品 → 约需 30 分钟,分批进行

后台作业会通过 Webhook / Polling 监听完成状态,可以安全关闭 AITSEO 页面。

数据权限说明

AITSEO 请求的 OAuth scope 最小:

Scope用途可选吗
read_content读取 Blog / Page 结构必要
write_content创建 / 更新 Blog / Page必要
read_products读取产品列表可选(只用博客不需要)
write_products更新产品描述可选(不做产品优化就不需要)
read_orders / customersAITSEO 从不请求这些敏感权限

你可以随时在 Shopify Admin → Apps → AITSEO → Uninstall 撤销所有权限。

常见问题

OAuth 跳转失败

  • 店铺名称拼写错误(多打了 https://.com
  • Shopify 店铺处于 frozentrial expired 状态
  • 浏览器第三方 cookie 被禁用

发布成功但文章不在网站上显示

  • Shopify 文章的 published_at 是未来时间(定时发布)
  • Blog 本身没在主题里 expose 为独立页面,需要 /blogs/news 前缀
  • 文章状态是 Hidden

产品描述更新后原主题样式丢了

  • AI 生成的 HTML 可能简化了某些自定义 Liquid 语法
  • 解决:在「产品批量优化」里开启「保留原主题 Liquid 片段