shopify-admin-discount-ab-analysis
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shopify-admin-discount-ab-analysis" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0d09e8ca1d714c781b660a56cf6a31883d2a810f642bd6a0aedb108cf42df501. Verify the upstream source and version against https://github.com/40RTY-ai/shopify-admin-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Compare redemption rates and revenue performance of two or more discount codes within a specified date range.
Introduction source: third_party · 40RTY-ai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Compare redemption rates and revenue performance across two or more discount codes over a specified date range.
- Inputs and outputs
- A comparison table per code (displayed inline): | Code | Uses (asyncUsageCount) | Orders in Range | Total Revenue | Avg Order Value | Revenue per Use | |------|------------------------|-----------------|---------------|-----------------|-----------------| | SAVE10 | ... | ... | ... | ... | ... | | WELCOME15 | ... | ... | ... | ... | ... | For `format: json`, the `results` array contains one object per code with keys: `code`, `async_usage_count`, `orders_in_range`, `total_revenue`, `avg_order_value`, `revenue_per_use`.
- Software, accounts and paid services
- Authenticated Shopify CLI session: `shopify auth login --store <domain>` API scopes: `read_discounts`, `read_orders`
- Testing
- Not tested
Browse files
Frontmatter
name: shopify-admin-discount-ab-analysis
role: conversion-optimization
description: "Compare redemption rates and revenue performance across two or more discount codes over a specified date range."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- discountNodes:query
- orders:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLIPurpose
Compares how different discount codes perform against each other by redemption count and revenue generated. Useful for A/B testing promotional offers without a dedicated analytics app — provide two or more codes and a date range, and the skill queries Shopify for discount metadata and order revenue, then produces a side-by-side comparison table. Read-only: no mutations are executed.
Prerequisites
- Authenticated Shopify CLI session:
shopify auth login --store <domain> - API scopes:
read_discounts,read_orders
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| format | string | no | human | Output format: human or json |
| dry_run | bool | no | false | Preview operations without executing mutations |
| discount_codes | array | yes | — | Array of 2 or more discount code strings to compare (e.g., ["SAVE10", "WELCOME15"]) |
| date_range_start | string | yes | — | Start date in ISO 8601 (e.g., 2025-01-01) |
| date_range_end | string | yes | — | End date in ISO 8601 (e.g., 2025-01-31) |
Workflow Steps
-
OPERATION:
discountNodes— query Inputs:first: 50,query: "code:<code>"(one query per code indiscount_codes) Expected output: Discount metadata: title, code strings,asyncUsageCount, status,startsAt,endsAtper code -
OPERATION:
orders— query (one paginated query per discount code) Inputs:first: 250,query: "discount_code:<code> created_at:>='<date_range_start>' created_at:<='<date_range_end>'", pagination cursor Expected output: Orders containing the discount code withtotalPriceSet; paginate untilhasNextPage: false; aggregate: count, sum revenue, compute avg order value
GraphQL Operations
# discountNodes:query — validated against api_version 2025-01
query DiscountNodes($first: Int!, $query: String) {
discountNodes(first: $first, query: $query) {
edges {
node {
id
discount {
... on DiscountCodeBasic {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
usageLimit
status
startsAt
endsAt
}
... on DiscountCodeBxgy {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
status
}
... on DiscountCodeFreeShipping {
title
codes(first: 10) {
edges {
node {
code
asyncUsageCount
}
}
}
status
}
}
}
}
}
}
# orders:query (by discount code) — validated against api_version 2025-01
query OrdersByDiscountCode($first: Int!, $after: String, $query: String) {
orders(first: $first, after: $after, query: $query) {
edges {
node {
id
createdAt
totalPriceSet {
shopMoney { amount currencyCode }
}
discountCodes
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: discount-ab-analysis ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝
After each step, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>
On completion, emit:
For format: human (default):
══════════════════════════════════════════════
OUTCOME SUMMARY
Codes analyzed: <n>
Date range: <start> to <end>
Errors: 0
Output: none
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "discount-ab-analysis",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": false,
"steps": [
{ "step": 1, "operation": "DiscountNodes", "type": "query", "params_summary": "<n> codes queried", "result_summary": "<n> discount nodes found", "skipped": false },
{ "step": 2, "operation": "OrdersByDiscountCode", "type": "query", "params_summary": "date range <start> to <end>", "result_summary": "<n> orders aggregated", "skipped": false }
],
"outcome": {
"codes_analyzed": 0,
"date_range_start": "<start>",
"date_range_end": "<end>",
"results": [
{
"code": "SAVE10",
"async_usage_count": 0,
"orders_in_range": 0,
"total_revenue": "0.00",
"avg_order_value": "0.00",
"revenue_per_use": "0.00"
}
],
"errors": 0,
"output_file": null
}
}
Output Format
A comparison table per code (displayed inline):
| Code | Uses (asyncUsageCount) | Orders in Range | Total Revenue | Avg Order Value | Revenue per Use |
|---|---|---|---|---|---|
| SAVE10 | ... | ... | ... | ... | ... |
| WELCOME15 | ... | ... | ... | ... | ... |
For format: json, the results array contains one object per code with keys: code, async_usage_count, orders_in_range, total_revenue, avg_order_value, revenue_per_use.
Error Handling
| Error | Cause | Recovery |
|---|---|---|
| Discount code not found | Code doesn't exist or was deleted | Verify code in Shopify admin |
| No orders returned for a code | No orders used this code in the date range | Widen date range or verify code was active |
discount_codes has fewer than 2 entries |
Can't do A/B with 1 code | Provide at least 2 codes |
| Rate limit (429) | Too many paginated orders queries | Wait and retry; reduce date range |
Best Practices
asyncUsageCountis the lifetime usage count from the discount object —orders_in_rangeis what was redeemed in your date window. Both are reported for full context.- For codes with high usage, the orders query will paginate — larger date ranges may produce many API calls. Consider narrowing the date range for faster results.
- Revenue per use is the best signal for comparing codes with different usage volumes.
- Run this analysis at the end of a campaign period before deciding which discount strategy to repeat.
- If
asyncUsageCountis 0 for a code, check that the code was active during the date range and correctly applied at checkout.
Version history
-
v1.1.0
GitHub ↗
Original release notes
## 🤖 New category: Agentic Commerce Readiness The fix-it side of the [**agentiq.report**](https://agentiq.report) audit. The audit tells operators *where* AI shopping agents (ChatGPT, Gemini, Perplexity, agentic checkout) can't find, read, or recommend their store. This release adds **10 skills that remediate those findings** via the native Shopify Admin GraphQL toolkit — closing the loop: **audit finds the gap → run the matching skill → re-audit confirms.** Every skill declares the audit **signals** it fixes (`audit_signals` frontmatter), so a finding in the report maps directly to the skill that resolves it. ### Skills - **`agentic-readiness-audit`** — flagship, read-only store-side scorecard that routes each gap to its fix skill - **`agentic-product-jsonld-backfill`** — barcode/GTIN, vendor, product type for complete Product JSON-LD - **`agentic-image-alt-text`** — descriptive alt text on product media - **`agentic-description-enrichment`** — fact-rich descriptions for AI quoting - **`agentic-metafields-setup`** — define + populate agentic metafields for filtering - **`agentic-product-taxonomy`** — Shopify Standard Product Taxonomy categories - **`agentic-crawler-access`** — allow GPTBot/ClaudeBot/PerplexityBot… in `robots.txt.liquid` - **`agentic-llms-txt`** — publish a curated `/llms.txt` for AI assistants - **`agentic-organization-schema`** — Organization JSON-LD (sameAs, contactPoint) into the theme - **`agentic-policy-readability`** — machine-readable shipping/returns policies Plus a weekly **`agentic-readiness-monitor`** routine that re-audits and alerts on regressions. ### Stats **116 skills across 11 categories** (was 106/10), **21 routines** (was 20). All GraphQL validated against the live Admin 2025-01 schema; `pnpm validate:index` passes (116 skills, 64 operations). ### Notes Theme-editing and policy skills default to `dry_run`/`audit` mode, write inside managed `# BEGIN/END` blocks, and recommend duplicating the theme first.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 直接解决电商运营中的核心痛点:折扣码 A/B 测试分析
- 提供明确的商业价值,帮助用户优化促销策略
- 功能闭环完整,从数据查询到结果展示形成完整工作流
Highlights
- description 精准描述核心功能:比较多个折扣码的兑换率和收入表现
- 触发词覆盖完整,边界清晰,无歧义
Highlights
- Workflow Steps 分步清晰,逻辑严谨
- Session Tracking 提供完整的执行状态追踪机制
- Output Format 同时支持 human-readable 表格和结构化 JSON
- Error Handling 覆盖主要异常场景并提供恢复建议
Highlights
- GraphQL 操作已验证 api_version 2025-01,确保兼容性
- 只读操作设计,无数据修改风险
- 分页查询处理完善,支持大数据量场景
- Prerequisites 明确要求认证和权限,避免执行失败
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Authenticated Shopify CLI session: `shopify auth login --store <domain>` API scopes: `read_discounts`, `read_orders`
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.