Chapter 2: Product Requirements Document

2.1 Document Overview

Purpose

This Product Requirements Document (PRD) defines the complete functional, non-functional, integration, and user experience requirements for AdPriority. It serves as the authoritative reference for what the product must do, how it must perform, and what constraints it must operate within.

Every feature described in this document traces back to the core problem statement from Chapter 1: retailers waste ad spend because they cannot efficiently manage which products deserve the most advertising budget. Requirements that do not serve this purpose are out of scope.

Scope

This PRD covers AdPriority version 1.0 through version 2.0, spanning four development phases:

PhaseScopeTimeline
Phase 0Nexus Clothing MVP – manual feed pipeline, validated with real storeWeek 1-2
Phase 1SaaS Foundation – Shopify app with OAuth, database, basic priority UI, automated Sheets syncWeek 3-4
Phase 2Full Product – seasonal automation, rules engine UI, new arrival boost, tag modifiersWeek 5-8
Phase 3App Store Launch – billing integration, onboarding flow, App Store submission, scale to 100+ merchantsWeek 9-12

Requirements marked with a phase tag indicate the earliest phase in which they must be implemented.

Audience

ReaderHow to Use This Document
DeveloperImplementation reference for all features, data formats, and API contracts
Product OwnerPrioritization guide with requirement IDs for backlog management
QA EngineerAcceptance criteria for test case design
DesignerUI/UX requirements and component specifications
StakeholderFeature scope validation and timeline alignment

Version History

VersionDateAuthorChanges
1.02026-02-10BlueprintInitial PRD compiled from research documents

Requirement ID Conventions

All requirements use a prefix that indicates their category:

PrefixCategoryExample
FR-Functional RequirementFR-01: Priority Score Definition
NFR-Non-Functional RequirementNFR-01: Page Load Time
IR-Integration RequirementIR-01: Shopify App Installation
UIR-UI/UX RequirementUIR-01: Dashboard Layout
DR-Data RequirementDR-01: Nexus Catalog Baseline

2.2 Product Description

What AdPriority Is

AdPriority is a Shopify embedded application that automates product priority scoring for Google Ads Performance Max (PMAX) campaigns. It assigns a 0-5 priority score to every product in a merchant’s catalog, then syncs those scores as custom labels to Google Merchant Center (GMC). Merchants use these labels to segment PMAX campaigns so that high-priority products receive more ad budget and low-priority products receive less or none.

Core Value Proposition

BEFORE AdPriority                    AFTER AdPriority
================                     ================

All products treated equally         Products scored 0-5 automatically
  |                                    |
  v                                    v
Budget spread evenly                 Budget allocated by priority
  |                                    |
  v                                    v
Shorts get ads in winter             Shorts excluded in winter (score 0)
Dead stock gets impressions          Dead stock excluded always (score 0)
New arrivals buried                  New arrivals boosted (score 5)
  |                                    |
  v                                    v
Poor ROAS                            15-30% ROAS improvement
Hours of manual label management     Automated, zero-maintenance

Product Boundaries

What AdPriority IS:

  • A priority scoring system with a 0-5 scale
  • A rules engine that calculates scores from product attributes, categories, seasons, and tags
  • A sync pipeline that writes scores as custom labels to Google Merchant Center
  • A seasonal automation engine that adjusts priorities on season boundaries
  • A Shopify embedded app built with Polaris components

What AdPriority IS NOT:

  • Not a bid management tool (it does not set bids or budgets in Google Ads)
  • Not a feed management platform (it only writes custom labels, not full product feeds)
  • Not an analytics dashboard (Pro tier adds read-only performance data, but it is not a reporting tool)
  • Not a campaign builder (merchants still structure their PMAX campaigns manually)
  • Not a multi-channel tool (v1.0 targets Google Ads only, not Facebook or Bing)

2.3 Functional Requirements

2.3.1 Priority Scoring System

FR-01: Priority Score Definition

Phase: 0 | Priority: P0

Every product receives a single integer score from 0 to 5 that directly controls how aggressively it is advertised in Google Ads.

ScoreNameBudget BehaviorTypical Use CasesGMC Label Value
5Push HardMaximum budget, aggressive biddingSeasonal bestsellers (shorts in summer, jackets in winter), hot new arrivals in first 14 days, proven high-margin itemspriority-5
4StrongHigh budget, balanced approachCore performers with solid sales history, products with seasonal relevance, name brand items with strong recognitionpriority-4
3NormalStandard budget, conservative biddingYear-round staples (jeans, fitted caps), average performers, baseline catalog itemspriority-3
2LowMinimal budget, strict ROAS targetsOff-season items still in stock, low-margin products, overstocked items, underwear and basics, accessoriespriority-2
1MinimalVery low budget, highest ROAS threshold onlyEnd-of-season clearance, slow movers approaching dead stock, items with sale tagspriority-1
0ExcludeZero ad spendArchived products, dead stock (DEAD50 tagged), out-of-stock variants, gift cards, non-shoppable items (insurance, shipping protection)priority-0

Constraints:

  • Score must be an integer between 0 and 5 inclusive
  • Every active product must have a score (no null scores)
  • Default score for unclassified products is 2 (Low)
  • Score is stored at the product level; variants inherit the product score unless individually overridden (future feature)

Acceptance Criteria:

  • Every product in the database has a priority_score column with a CHECK (priority_score BETWEEN 0 AND 5) constraint
  • Products without matching rules receive default score of 2
  • Score values map to GMC label values using the format priority-{score}

FR-02: Score Assignment Methods

Phase: 0 (manual), 1 (bulk, rules), 2 (seasonal, performance) | Priority: P0

AdPriority supports five methods of assigning priority scores, each appropriate for different use cases:

MethodDescriptionPhaseUser Action
ManualMerchant sets score for an individual product via the UIPhase 1Click product, select score from dropdown
BulkMerchant selects multiple products and assigns the same scorePhase 1Multi-select products, choose score, apply
RulesCategory-based automatic assignment (product type, collections, tags)Phase 1Configure rules in rules engine, scores auto-calculate
SeasonalCalendar-driven automatic adjustment based on season x category matrixPhase 2Configure seasonal calendar, scores auto-adjust on season boundaries
PerformanceROAS-based recommendations suggesting score changes (Pro tier)Phase 3Review recommendations, accept or dismiss

Acceptance Criteria:

  • Manual scoring updates a single product and marks it as priority_source = 'manual'
  • Bulk scoring updates up to 1,000 products in a single operation
  • Rules-based scoring recalculates on product import and webhook events
  • Seasonal scoring triggers automatically on season transition dates
  • Performance recommendations are read-only suggestions, not automatic changes

FR-03: Score Override Hierarchy

Phase: 1 | Priority: P0

When multiple scoring methods apply to the same product, the highest-priority method wins. The hierarchy is evaluated top-to-bottom; the first matching rule determines the score.

SCORE OVERRIDE HIERARCHY (highest priority wins)
=================================================

  1. Manual override          -- Merchant locks a specific score
     |                           (priority_locked = true)
     v
  2. Exclusion tags           -- "archived" or "DEAD50" force score to 0
     |                           (hard override, cannot be raised)
     v
  3. Inventory warnings       -- "warning_inv_1" reduces score by 1
     |                           (applied as modifier, not override)
     v
  4. New arrival boost        -- Products created within 14 days get score 5
     |                           (configurable duration and target score)
     v
  5. Tag modifiers            -- "in-stock" adds +1, "NAME BRAND" adds +1,
     |                           "Sale" subtracts -1
     v
  6. Seasonal calendar        -- Category-specific seasonal adjustment
     |                           (from the season x category matrix)
     v
  7. Category default         -- Base score from product type group mapping
     |
     v
  8. Global default           -- Score 2 if no rules match

Modifier Stacking Rules:

  • Tag modifiers stack additively (e.g., in-stock +1 and NAME BRAND +1 = +2 total)
  • Final score is clamped to the 0-5 range: Math.min(5, Math.max(0, score))
  • Override tags (archived, DEAD50) short-circuit all other rules and return 0 immediately
  • Manual overrides are respected until the merchant unlocks the product

Real-World Example with Nexus Clothing Data:

Product: "Jordan Craig Stacked Jeans" (active, Winter season)
  Step 1: Manual override?  No (priority_locked = false)
  Step 2: Exclusion tags?   No
  Step 3: Inventory warning? No
  Step 4: New arrival?      No (created > 14 days ago)
  Step 5: Tag modifiers:    NAME BRAND = +1 (store later)
  Step 6: Seasonal calendar: Jeans & Pants, Winter = 4
  Step 7: Category default:  Jeans & Pants = 4 (not needed, seasonal applied)
  Apply modifiers: 4 + 1 (NAME BRAND) = 5
  Final priority: 5 (PUSH HARD)

Product: "Generic Mesh Shorts" (active, Winter season)
  Step 1: Manual override?  No
  Step 2: Exclusion tags?   No
  Step 3: Inventory warning? No
  Step 4: New arrival?      No
  Step 5: Tag modifiers:    None relevant
  Step 6: Seasonal calendar: Shorts, Winter = 0
  Final priority: 0 (EXCLUDE)

Product: "Old Season Hoodie" (archived, DEAD50 tag)
  Step 1: Manual override?  No
  Step 2: Exclusion tags?   Yes -- "archived" found
  Final priority: 0 (EXCLUDE) -- short-circuit, no further processing

Acceptance Criteria:

  • Override hierarchy is enforced in the exact order specified
  • Manual overrides persist until explicitly unlocked by merchant
  • Exclusion tags short-circuit all subsequent rules
  • Tag modifiers stack additively and result is clamped to 0-5
  • priority_source column records which method determined the final score

2.3.2 Category Mapping

FR-10: Category Rules

Phase: 1 | Priority: P0

The category mapping system translates Shopify product types into priority scores. Because product type names can be long and hierarchical (Nexus uses a {Gender}-{Department}-{SubCategory}-{Detail} convention with 90 unique types), AdPriority groups them into manageable category groups.

Rule Capabilities:

CapabilityDescriptionExample
Product type matchExact or partial match on product_type fieldproduct_type = "Men-Tops-T-Shirts"
Product type containsSubstring match for hierarchical typesproduct_type CONTAINS "Shorts"
Collection membershipProduct belongs to a specific collectioncollection = "New Arrivals"
Tag-based rulesProduct has a specific tagtag = "clearance"
AND logicMultiple conditions must all be trueproduct_type = "Shorts" AND season = "Summer"
OR logicAny condition can be truetag = "archived" OR tag = "DEAD50"
Temporal conditionsTime-based rules with expirycollection = "New Arrivals" FOR 14 days

Category Group Structure:

AdPriority organizes 90+ Nexus product types into 20 manageable groups. Each group maps multiple product types to a single set of priority rules.

GroupProduct Types IncludedProduct CountDefault Priority
T-ShirtsMen-Tops-T-Shirts, Boys-Tops-T-Shirts, Men-Tops-Crop-Top, Men-Tops-Tank Tops1,3633
Long Sleeve TopsMen-Tops-T-Shirts-Long Sleeve543
Jeans & PantsMen-Bottoms-Pants-Jeans, Men-Bottoms-Stacked Jeans, Boys-Bottoms-Jeans, Men-Bottoms-Pants-Track Pants, Men-Bottoms-Pants-Cargo, Men-Bottoms-Stacked Track Pants9114
SweatpantsMen-Bottoms-Pants-Sweatpants, Men-Bottoms-Stacked Sweatpants943
ShortsAll *-Shorts-* types (8 types)3153
Swim ShortsMen-Bottoms-Shorts-Swim-Shorts402
Hoodies & SweatshirtsMen-Tops-Hoodies & Sweatshirts, Boys-Tops-Hoodies2643
Outerwear - HeavyPuffer Jackets, Shearling Coats723
Outerwear - MediumDenim Jackets, Varsity Jackets, Fleece, Sports, Vests2323
Outerwear - LightTrack Jackets, Windbreakers393
Headwear - CapsFitted, Dad Hat, Snapback, Low Profile7773
Headwear - Cold WeatherKnit Beanies, Balaclavas1712
Headwear - SummerBucket Hats512
JoggersMen-Bottoms-Joggers, Boys-Bottoms-Joggers863
Footwear - SandalsSandals & Slides582
Footwear - ShoesMen/Women Shoes483
Underwear & SocksMen/Women Underwear, Socks, Boys Underwear5232
AccessoriesBags, Jewelry, Belts, Wallet Chains3502
Women - ApparelWomen-Tops, Leggings, Dresses, Jumpsuits, Sets802
ExcludeBath & Body, Household Supplies, Gift Cards, Insurance, Shipping Protection~500

Acceptance Criteria:

  • Merchant can create category groups that map multiple product types to a single priority
  • Rules support AND/OR logic for combining conditions
  • Unmapped product types receive the global default score (2)
  • Category groups are stored per-store (multi-tenant safe)
  • Changing a category rule triggers recalculation for all affected products

FR-11: Rule Examples with Nexus Data

Phase: 1 | Priority: P1

The rules engine must support the following patterns, all validated against real Nexus Clothing data:

# Seasonal category rules
IF product_type CONTAINS "Shorts" AND season = "Summer"
  THEN priority = 5

IF product_type CONTAINS "Shorts" AND season = "Winter"
  THEN priority = 0

IF product_type CONTAINS "Hoodies" AND season = "Winter"
  THEN priority = 5

IF product_type CONTAINS "Puffer" AND season = "Summer"
  THEN priority = 0

# Collection-based rules
IF collection = "New Arrivals"
  THEN priority = 5 FOR 14 days

# Tag-based rules (overrides)
IF tag = "archived" OR tag = "DEAD50"
  THEN priority = 0 (override)

IF tag = "clearance"
  THEN priority = 1

# Tag-based rules (modifiers)
IF tag = "NAME BRAND"
  THEN priority + 1

IF tag = "in-stock"
  THEN priority + 1

IF tag = "Sale"
  THEN priority - 1

IF tag = "warning_inv_1"
  THEN priority - 1

# Vendor-based rules (future)
IF vendor = "Nexus Clothing"
  THEN priority + 1 (store brand boost)

Acceptance Criteria:

  • All rule patterns above can be expressed in the rules engine
  • Rules can be tested with a “preview” mode that shows affected products without applying changes
  • Rules are evaluated in priority order (see FR-03 hierarchy)

2.3.3 Product Mapping

FR-20: Product Identification

Phase: 0 | Priority: P0

AdPriority must correctly map Shopify product and variant identifiers to Google Merchant Center product IDs. The mapping is the foundation of the supplemental feed pipeline – an incorrect ID means the custom label will not be applied.

GMC Product ID Format (verified from live GMC export, 124,060 products):

Format:    shopify_US_{productId}_{variantId}
Example:   shopify_US_8779355160808_46050142748904

Components:
  shopify    -- Constant prefix (identifies source platform)
  US         -- Country code (ISO 3166-1 alpha-2)
  8779355160808      -- Shopify product ID (13 digits)
  46050142748904     -- Shopify variant ID (14 digits)

Item Group ID (parent product, used for variant grouping in GMC):

Format:    {productId}
Example:   8779355160808

Verified Real Examples from Nexus GMC Export:

Shopify Product IDShopify Variant IDGMC Product ID
877935516080846050142748904shopify_US_8779355160808_46050142748904
912899457047247260097118440shopify_US_9128994570472_47260097118440
905736706480847004004712680shopify_US_9057367064808_47004004712680
923879741872847750439567592shopify_US_9238797418728_47750439567592
760955171658442582395650280shopify_US_7609551716584_42582395650280

Storage Strategy: Hybrid approach (recommended)

LayerRoleRationale
PostgreSQL databasePrimary source of truth for priority scores and sync stateFull query capability, fast bulk operations, no API rate limits
Shopify metafieldsBackup and recovery mechanismPersists with product, survives database issues

Metafield Schema:

{
  "namespace": "adpriority",
  "key": "config",
  "type": "json",
  "value": {
    "priority": 4,
    "priority_source": "seasonal",
    "priority_locked": false,
    "last_synced_at": "2026-02-10T10:00:00Z",
    "custom_labels": {
      "label_0": "priority-4",
      "label_1": "winter",
      "label_2": "jeans-pants",
      "label_3": "in-stock",
      "label_4": "name-brand"
    }
  }
}

Acceptance Criteria:

  • GMC product IDs are generated using the format shopify_US_{productId}_{variantId}
  • All variant-level IDs are stored (GMC uses variant-level IDs exclusively)
  • Product mapping table has a computed gmc_product_id column
  • Mapping handles product ID changes gracefully (e.g., product delete + recreate)

FR-21: Custom Label Structure

Phase: 0 | Priority: P0

AdPriority uses all five Google Merchant Center custom label slots to provide rich segmentation data for Google Ads campaigns. The label schema was designed to stay well within GMC’s limits while providing maximum campaign segmentation flexibility.

LabelPurposeExample ValuesUnique ValuesGMC Limit
custom_label_0Priority Scorepriority-0 through priority-561,000
custom_label_1Seasonwinter, spring, summer, fall41,000
custom_label_2Category Groupt-shirts, jeans-pants, outerwear-heavy, headwear-caps~201,000
custom_label_3Product Statusnew-arrival, in-stock, low-inventory, clearance, dead-stock51,000
custom_label_4Brand Tiername-brand, store-brand, off-brand31,000

Total unique values across all labels: ~38 (well within the 5,000 total limit)

Status Determination Logic:

StatusConditionPriority Order
dead-stockTag archived or DEAD50 present, or product status is archived1 (highest)
low-inventoryTag warning_inv_1 or warning_inv present2
new-arrivalProduct created within last 30 days3
clearanceTag Sale present4
in-stockDefault for active products with no special tags5 (lowest)

Brand Tier Determination Logic:

TierCondition
store-brandVendor is “Nexus Clothing”
name-brandTag NAME BRAND present, or vendor in recognized brand list (New Era, Jordan Craig, Psycho Bunny, LACOSTE, Gstar Raw, Ed Hardy, etc.)
off-brandDefault for all other products

Acceptance Criteria:

  • All five custom labels are populated for every active variant in the supplemental feed
  • Label values use lowercase with hyphens (e.g., jeans-pants, not Jeans & Pants)
  • Label values are within the 100-character maximum per value
  • Total unique values per label do not exceed 1,000

2.3.4 Seasonal Calendar

FR-30: Season Definitions

Phase: 2 | Priority: P1

AdPriority uses a four-season calendar with configurable start/end dates. The default configuration follows the Northern Hemisphere retail calendar.

SeasonDefault StartDefault EndKey Retail Events
WinterDecember 1February 28/29Holidays, New Year, Valentine’s Day
SpringMarch 1May 31Spring Break, Easter, Memorial Day
SummerJune 1August 31Vacation, July 4th, Back-to-school prep
FallSeptember 1November 30Back to School, Thanksgiving, Black Friday, Cyber Monday
ANNUAL SEASON TIMELINE
=======================

JAN | FEB | MAR | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC
|___WINTER____|______SPRING______|______SUMMER______|______FALL______|WIN
       ^              ^                  ^                 ^
     Feb 28         May 31             Aug 31           Nov 30

Configuration Options:

SettingDefaultConfigurableNotes
HemisphereNorthernYesInverts season dates for Southern Hemisphere
TimezoneAmerica/New_YorkYesUsed for season boundary calculations
Season datesFixed month boundariesYes (Growth+ tier)Merchants can customize per season
Grace periodNoneYes (Growth+ tier)15-day grace period around transitions

Acceptance Criteria:

  • Season detection correctly identifies the current season based on date and timezone
  • Season transitions trigger automatic priority recalculation
  • Merchants can preview the impact of an upcoming season change before it takes effect
  • Manual season override allows merchants to trigger early or late transitions

FR-31: Seasonal Rules

Phase: 2 | Priority: P1

Each category group has a configurable priority score per season. This forms the Category x Season matrix, which is the core of the seasonal automation engine.

Full Seasonal Priority Matrix (Nexus Clothing default configuration):

Category GroupWinterSpringSummerFallDefault
T-Shirts24533
Long Sleeve Tops43143
Jeans & Pants44354
Sweatpants43143
Shorts03513
Swim Shorts02502
Hoodies & Sweatshirts53153
Outerwear - Heavy51043
Outerwear - Medium43043
Outerwear - Light24133
Headwear - Caps33333
Headwear - Cold Weather51032
Headwear - Summer03422
Joggers43243
Footwear - Sandals02502
Footwear - Shoes33333
Underwear & Socks22222
Accessories22222
Women - Apparel23322
Exclude00000

Holiday Modifiers:

In addition to the seasonal matrix, specific shopping events can temporarily boost priorities:

EventDatesModifierAffected Categories
Valentine’s DayFeb 10-14+1Accessories, Jewelry
EasterVariable+1Spring items
Memorial DayMay (last Monday)+1Summer items
July 4thJul 1-4+1Casual wear
Back to SchoolAug 1 - Sep 15+2Jeans, T-Shirts, Hoodies
Labor DaySep (first Monday)+1All categories
Black FridayNov (last Friday)+2All categories
Cyber MondayMonday after Black Friday+2All categories
ChristmasDec 1-25+2All categories

Holiday Modifier Rules:

  • Holiday modifiers are additive on top of the seasonal base score
  • Final score is clamped to 0-5 after applying holiday modifiers
  • Holiday modifiers do not override manual locks or exclusion tags
  • Merchants can enable/disable individual holidays
  • Custom holiday events can be created (Growth+ tier)

Acceptance Criteria:

  • Seasonal priorities auto-apply on season transition dates
  • Category x Season matrix is editable per merchant
  • Holiday modifiers apply and expire on the configured dates
  • Preview shows exact products and scores that will change on next transition
  • Manual season trigger overrides the date-based automatic transition

2.3.5 New Arrival Automation

FR-40: New Arrival Boost

Phase: 2 | Priority: P1

New products added to the store automatically receive a high priority score for a configurable period, ensuring they get advertising visibility during their launch window.

Configuration Parameters:

ParameterDefaultRangeDescription
enabledtrueBooleanEnable or disable the new arrival boost
days_threshold141-90Number of days a product is considered “new”
boost_priority51-5Priority score during the boost period
decay_enabledfalseBooleanGradually reduce priority over time
decay_schedule[5, 4, 3]Array of scoresScores at each decay interval
decay_interval_days71-30Days between each decay step

Behavior:

WITHOUT DECAY (default):
  Day 0-14:   Priority 5 (Push Hard)
  Day 15+:    Falls back to category/seasonal score

WITH DECAY ENABLED:
  Day 0-7:    Priority 5 (Push Hard)
  Day 8-14:   Priority 4 (Strong)
  Day 15-21:  Priority 3 (Normal)
  Day 22+:    Falls back to category/seasonal score

Interaction with Override Hierarchy:

  • New arrival boost sits at position 4 in the hierarchy (see FR-03)
  • Manual overrides take precedence over new arrival boost
  • Exclusion tags (archived, DEAD50) take precedence over new arrival boost
  • Inventory warnings take precedence over new arrival boost
  • New arrival boost takes precedence over tag modifiers, seasonal rules, and category defaults

Detection Method:

  • Shopify created_at timestamp compared against current date
  • Products detected via products/create webhook for real-time processing
  • Daily reconciliation job catches any missed webhook events

Acceptance Criteria:

  • Products created within days_threshold days automatically receive boost_priority score
  • Boost expires silently after the threshold period, reverting to standard scoring
  • Decay schedule (when enabled) reduces score on the configured interval
  • Configuration is per-store, not global
  • Manual overrides are not affected by new arrival boost

2.3.6 Google Merchant Center Sync

FR-50: Sync Methods

Phase: 0 (Sheets), 2 (Content API), 1 (CSV) | Priority: P0

AdPriority supports three methods of syncing custom labels to Google Merchant Center, available at different subscription tiers:

MethodTierLatencyMerchant SetupTechnical Complexity
Google Sheets supplemental feedAll tiersDaily (GMC fetches automatically)One-time: share Sheet URL, add as supplemental feed in GMCLow – uses Sheets API only
Content API for ShoppingPro, EnterpriseNear-real-time (within 2x/day limit)One-time: connect Google account via OAuthMedium – requires GMC OAuth
Manual CSV exportAll tiers (fallback)Manual upload by merchantDownload CSV, upload to GMCNone – offline process

Google Sheets Pipeline (MVP and primary method):

AdPriority Database
       |
       |  Google Sheets API (googleapis/sheets/v4)
       v
Google Sheet (shared publicly, Viewer access)
  +----------------------------------------------------------------+
  | id                                    | custom_label_0 | ...    |
  | shopify_US_8779355160808_46050142748904 | priority-5   | ...    |
  | shopify_US_9128994570472_47260097118440 | priority-4   | ...    |
  +----------------------------------------------------------------+
       |
       |  GMC auto-fetches daily (or on manual trigger)
       v
Google Merchant Center
       |
       |  Labels applied to matching products
       v
Google Ads PMAX Campaigns

Feed Size Estimates for Nexus:

MetricValue
Active products in Shopify2,425
Estimated active variants in GMC~15,000-20,000
Rows in supplemental feed~15,000-20,000
Columns per row6 (id + 5 custom labels)
Total cells~120,000
Google Sheets cell limit10,000,000
Usage percentage~1.2%

Acceptance Criteria:

  • Google Sheets supplemental feed is generated with correct column names (id, custom_label_0 through custom_label_4)
  • Product IDs in the Sheet exactly match GMC primary feed IDs (case-sensitive)
  • Sheet is shared with “Anyone with the link” at Viewer access
  • CSV export produces a downloadable file with the same structure
  • Content API integration (Pro tier) uses products.custombatch for efficiency

FR-51: Sync Schedule

Phase: 1 | Priority: P0

TriggerBehaviorLatency
Priority changeMark product as needs_sync = true in databaseImmediate (database)
Scheduled bulk syncWrite all pending changes to Google SheetConfigurable: hourly or daily
Manual triggerMerchant clicks “Sync Now” buttonImmediate write to Sheet
Season transitionBulk recalculate and sync all affected productsWithin 1 hour of transition
Product webhookRecalculate single product, queue for next syncNext scheduled sync

Sync Status Dashboard:

The UI must display:

  • Last sync timestamp
  • Number of products pending sync
  • Number of products successfully synced
  • Number of sync errors
  • “Sync Now” button for manual trigger

Acceptance Criteria:

  • Scheduled sync runs at merchant-configured intervals (minimum: daily)
  • Manual sync trigger writes to Sheet within 60 seconds
  • Sync status is visible on the dashboard
  • Products with needs_sync = true are included in the next scheduled sync
  • After successful sync, needs_sync is set to false and last_synced_at is updated

FR-52: Error Handling

Phase: 1 | Priority: P1

Error ScenarioDetectionResolutionMerchant Impact
Google Sheets API quota exceededAPI returns 429Exponential backoff retry (3 attempts, 1s/2s/4s delay)Sync delayed, not lost
Sheet permission revokedAPI returns 403Alert merchant, provide re-authorization linkSync paused until resolved
GMC feed processing errorGMC dashboard shows errorsLog error, alert merchant, provide troubleshooting linkLabels not applied for affected products
Product ID mismatchReconciliation job detects unmatched productsLog warning, exclude from feedAffected products have no labels
Network timeoutRequest times out after 30 secondsRetry with backoffSync delayed, not lost

Retry Configuration:

Max retries:          3
Initial delay:        1,000 ms
Backoff multiplier:   2
Maximum delay:        30,000 ms

Acceptance Criteria:

  • All sync errors are logged with timestamp, error type, and affected product IDs
  • Retry logic uses exponential backoff for transient failures
  • Persistent failures (3+ consecutive) trigger a merchant notification
  • Manual CSV export is always available as a fallback when automated sync fails
  • Error count is displayed on the sync status dashboard

2.3.7 Google Ads Integration (Pro Tier)

FR-60: Performance Data

Phase: 3 | Priority: P2

Pro tier merchants can connect their Google Ads account to view performance metrics segmented by priority tier.

Data PointSourceUpdate Frequency
Impressions per priority tierShopping Performance ViewDaily
Clicks per priority tierShopping Performance ViewDaily
Cost per priority tierShopping Performance ViewDaily
Conversions per priority tierShopping Performance ViewDaily
ROAS per priority tierCalculated (conversion value / cost)Daily
Spend by category groupShopping Performance View + category mappingDaily
Trend data (30/60/90 day)Historical aggregationDaily

GAQL Query Example:

SELECT
  segments.product_custom_attribute0,  -- priority score label
  metrics.impressions,
  metrics.clicks,
  metrics.cost_micros,
  metrics.conversions,
  metrics.conversions_value
FROM shopping_performance_view
WHERE segments.date DURING LAST_30_DAYS

Acceptance Criteria:

  • Performance data is fetched daily and stored in the database
  • Dashboard displays ROAS, spend, and conversion data grouped by priority tier
  • Historical trend charts show 30, 60, and 90-day windows
  • Data is read-only (AdPriority does not modify Google Ads settings)

FR-61: Recommendations

Phase: 3 | Priority: P3

Based on performance data, AdPriority generates actionable recommendations for priority score adjustments.

Recommendation TypeTriggerSuggested Action
Increase priorityProduct has ROAS > 2x average for its tier“Move from priority 3 to priority 4”
Decrease priorityProduct has ROAS < 0.5x average for its tier“Move from priority 4 to priority 2”
Budget waste alertHigh spend, zero conversions for 14+ days“Consider excluding (priority 0)”
Seasonal predictionHistorical data shows seasonal demand pattern“Shorts trending up – consider early Summer transition”

Acceptance Criteria:

  • Recommendations are displayed as dismissible cards in the dashboard
  • Each recommendation shows the current score, suggested score, and supporting data
  • Merchant can accept (applies change) or dismiss (hides recommendation)
  • Dismissed recommendations do not reappear for the same product within 30 days

2.4 Non-Functional Requirements

2.4.1 Performance Requirements

IDRequirementTargetMeasurement Method
NFR-01Page load time< 2 secondsLighthouse performance score
NFR-02Sync latency (Sheet write)< 5 minutes for full catalogTimed Sheets API operation
NFR-03Bulk operations1,000 products per minuteTimed batch update
NFR-04API response time< 500ms (95th percentile)Server-side APM logging
NFR-05Score calculation5,000 products in < 30 secondsTimed batch calculation
NFR-06Product import speed1,000 products per minuteTimed Shopify API pagination
NFR-07Sheet generation20,000 rows in < 2 minutesTimed Sheets API write
NFR-08Webhook processing< 5 seconds per eventEvent timestamp to completion

2.4.2 Scalability Requirements

TierMax ProductsMax Variants (est.)Max Syncs/DayMax UsersMax Rules
Starter ($29/mo)500~2,00024210
Growth ($79/mo)10,000~40,00096550
Pro ($199/mo)100,000~400,00028810Unlimited
Enterprise (Custom)UnlimitedUnlimitedUnlimitedUnlimitedUnlimited

Infrastructure Scaling Approach:

Load LevelStrategy
< 50 merchantsSingle PostgreSQL database, single app server, Google Sheets sync
50-500 merchantsConnection pooling, Redis caching, background job queue (Bull)
500+ merchantsRead replicas, horizontal app scaling, Content API for high-volume stores

2.4.3 Security Requirements

IDRequirementImplementationPhase
NFR-10OAuth 2.0 authenticationShopify token exchange flow + Google OAuthPhase 1
NFR-11Session token validationJWT verification with client secret, audience, expiryPhase 1
NFR-12Webhook HMAC verificationSHA-256 HMAC validation on all webhook payloadsPhase 1
NFR-13Encryption at restAES-256 for stored OAuth tokensPhase 1
NFR-14Encryption in transitHTTPS/TLS everywhere (no mixed content)Phase 1
NFR-15GDPR complianceThree mandatory webhooks, no customer PII storedPhase 1
NFR-16CCPA complianceData export and deletion on requestPhase 1
NFR-17Shop-scoped data isolationEvery database query includes store_id filterPhase 1
NFR-18No customer PII storedAdPriority stores only product data, never customer dataPhase 0
NFR-19Minimal scope requestsOnly read_products, write_products, read_inventoryPhase 1

2.4.4 Availability Requirements

IDRequirementTargetPhase
NFR-20Uptime SLA99.9% (< 8.77 hours downtime/year)Phase 3
NFR-21Graceful degradationManual CSV export always available if automated sync failsPhase 1
NFR-22Automated backupsDaily database backups with 30-day retentionPhase 1
NFR-23Disaster recoveryRestore from backup within 4 hoursPhase 2
NFR-24Zero data lossAll priority scores and rules recoverable after any failurePhase 1

2.5 Integration Requirements

2.5.1 Shopify Integration

IR-01: App Installation

Phase: 1 | Priority: P0

RequirementSpecification
Authentication flowOAuth 2.0 with token exchange (modern flow, no cookies)
App typeEmbedded (mandatory for new apps as of late 2024)
App Bridge versionv4+ (latest)
UI frameworkShopify Polaris v13.9+
Session managementSession tokens (JWTs signed with client secret)

Session Token Claims:

ClaimDescriptionExample
issShop admin URLhttps://nexus-clothes.myshopify.com/admin
destShop URLhttps://nexus-clothes.myshopify.com
audClient IDAdPriority app client ID
subUser IDShopify staff member ID
expExpirationUnix timestamp (1-minute validity)
jtiToken IDUnique identifier
sidSession IDSession identifier

IR-02: Data Access

Phase: 1 | Priority: P0

Required API Scopes:

ScopePurposeJustification (for App Store review)
read_productsFetch product data (titles, types, tags, collections, variants)“AdPriority reads product information to apply priority scoring rules and generate Google Merchant Center custom labels.”
write_productsStore priority scores in product metafields“AdPriority stores priority scores and sync status in product metafields for persistent data across sessions.”
read_inventoryCheck stock levels for inventory-based rules“AdPriority uses inventory levels to adjust priority scores (lower priority for out-of-stock items).”

Data Retrieved from Shopify:

Data TypeAPI EndpointFields Used
ProductsGET /admin/api/2024-01/products.jsonid, title, product_type, vendor, tags, status, created_at, handle
VariantsIncluded in products responseid, sku, inventory_quantity, price
CollectionsGET /admin/api/2024-01/collections.jsonid, title, products
MetafieldsGET /admin/api/2024-01/products/{id}/metafields.jsonnamespace=adpriority

IR-03: Webhooks

Phase: 1 | Priority: P0

Mandatory GDPR Webhooks (required for App Store approval – app will be rejected without these):

WebhookEndpointBehavior
customers/data_requestPOST /api/webhooks/customers-data-requestReturn 200 OK with note “No customer PII stored”
customers/redactPOST /api/webhooks/customers-redactReturn 200 OK (no action needed, no customer data stored)
shop/redactPOST /api/webhooks/shop-redactDelete all store data (rules, products, sync logs, settings)

App Lifecycle Webhooks:

WebhookEndpointBehaviorPriority
app/uninstalledPOST /api/webhooks/app-uninstalledDelete all store data, cancel billing subscriptionP0

Product Webhooks:

WebhookEndpointBehaviorPriority
products/createPOST /api/webhooks/products-createApply rules to new product, calculate priority, queue for syncP1
products/updatePOST /api/webhooks/products-updateCheck for type/tag changes, recalculate priority if changedP2
products/deletePOST /api/webhooks/products-deleteRemove from product mapping, remove from supplemental feedP2

Webhook Security:

All webhooks must verify the X-Shopify-Hmac-Sha256 header using HMAC-SHA256 with the app’s client secret. Unverified webhooks must be rejected with 401 Unauthorized.

2.5.2 Google Merchant Center

IR-10: Authentication

Phase: 0 (Sheets only, no auth), 2 (Content API) | Priority: P0 (Sheets), P2 (API)

MethodTierOAuth ScopeSetup
Google Sheets APIAllhttps://www.googleapis.com/auth/spreadsheetsApp creates and manages Sheet programmatically
Content API for ShoppingPro, Enterprisehttps://www.googleapis.com/auth/contentMerchant connects Google account via OAuth
Service accountsEnterpriseN/A (service account key)Generated in Google Cloud Console

IR-11: API Operations

Phase: 2 (Content API) | Priority: P2

OperationAPI EndpointPurpose
List productsGET /content/v2.1/{merchantId}/productsVerify product existence in GMC
Update labelsPATCH /content/v2.1/{merchantId}/products/{productId}Set custom labels via Content API
Batch updatePOST /content/v2.1/products/batchUpdate multiple products in one request
Product statusGET /content/v2.1/{merchantId}/productstatusesCheck for feed processing errors

Rate Limits:

LimitValueImpact
Product updates per day2x per productDaily sync schedule is within limits
Requests per minuteDynamic (throttling-based)Implement exponential backoff
Batch sizeUp to 10,000 entries per batch requestSufficient for most stores

2.5.3 Google Ads API (Pro Tier)

IR-20: Authentication

Phase: 3 | Priority: P2

RequirementSpecification
OAuth scopehttps://www.googleapis.com/auth/adwords
Developer tokenRequired (apply through Google Ads API Center)
Manager accountsSupported for agency users (Enterprise tier)
Customer IDMerchant provides their Google Ads customer ID

IR-21: API Operations

Phase: 3 | Priority: P2

OperationPurposeFrequency
Shopping Performance ViewProduct-level metrics (impressions, clicks, cost, conversions)Daily fetch
Campaign dataCampaign-level performanceDaily fetch
Asset group metricsPMAX asset group performanceDaily fetch
Listing group filtersVerify custom label-based product groupingOn demand

2.6 UI/UX Requirements

UIR-01: Dashboard

Phase: 1 | Priority: P0

The dashboard is the landing page of the app, providing an at-a-glance view of the store’s priority scoring status.

ComponentContentPolaris Component
Priority distribution chartBar or donut chart showing product count per score (0-5)Custom chart (Chart.js) in Card
Sync status cardLast sync time, pending count, error count, “Sync Now” buttonCard with Badge indicators
Upcoming seasonal changesNext season transition date, affected product count, preview linkCard with Banner (informational)
Quick statsTotal products scored, active rules, last sync, current seasonLayout with Card grid
Recent activityTimeline of recent priority changes, syncs, rule changesCard with list

UIR-02: Product Management

Phase: 1 | Priority: P0

ComponentBehaviorPolaris Component
Product listPaginated table (50-100 per page) showing product title, type, current priority, sync statusIndexTable or DataTable
SearchFilter by product title, SKU, or vendorTextField with search icon
FiltersFilter by priority score, category group, season, sync status, product statusFilters with ChoiceList
Inline priority editClick on priority badge to change score via dropdownSelect in IndexTable cell
Bulk selectCheckbox selection for multi-product actionsIndexTable built-in selection
Bulk editApply priority score to all selected productsBulkActions toolbar
CSV exportDownload current filtered view as CSVButton action
Priority badgeColor-coded badge showing score (red=0, orange=1-2, yellow=3, green=4-5)Badge with tone variants

UIR-03: Rules Engine

Phase: 2 | Priority: P1

ComponentBehaviorPolaris Component
Rule listOrdered list of all active rules with name, type, affected countIndexTable
Visual rule builderIF-THEN interface for creating rules without codeCard with Select, TextField
Rule testing previewShows which products would be affected before applyingModal with DataTable
Rule priority orderingDrag-and-drop to reorder rulesCustom drag handle or up/down buttons
Enable/disable toggleToggle individual rules on/off without deletingToggle switch
Rule templatesPre-built rules for common patterns (seasonal, new arrival, clearance)Card with Button actions

UIR-04: Seasonal Calendar

Phase: 2 | Priority: P1

ComponentBehaviorPolaris Component
Visual calendarTimeline view showing season boundaries across 12 monthsCustom component
Season configurationEdit start/end dates per seasonDatePicker or TextField
Category x Season matrixEditable grid showing priority per category per seasonDataTable with inline Select
Preview future changesShow products affected by next transitionButton to Modal with preview
Current season indicatorHighlight current season with countdown to next transitionBanner (informational)
Manual triggerButton to manually switch to a different seasonButton (destructive styling)

UIR-05: Settings

Phase: 1 | Priority: P0

ComponentBehaviorPolaris Component
Google account connectionOAuth flow to connect Google account (Sheets, GMC, Ads)Card with Button
Sync preferencesConfigure sync frequency (hourly, daily, manual)RadioButton group
Notification settingsToggle email alerts for sync errors, seasonal transitionsCheckbox list
New arrival configurationSet boost duration, priority, decay optionsTextField with Checkbox
Billing managementView current plan, upgrade/downgradeCard with plan comparison
Data exportExport all priority data as CSVButton action
Delete accountRemove all store data from AdPriorityButton (destructive) with Modal confirmation

2.7 Data Requirements

DR-01: Nexus Catalog Baseline

The following data has been verified from live Shopify Admin API and GMC product exports:

MetricValueSourceDate Verified
Total Shopify products5,582Shopify Admin API2026-02-10
Active products2,425Shopify Admin API2026-02-10
Archived products3,121Shopify Admin API2026-02-10
Draft products36Shopify Admin API2026-02-10
Unique product types90Shopify Admin API2026-02-10
Unique vendors175Shopify Admin API2026-02-10
Unique tags2,522Shopify Admin API2026-02-10
GMC total variants124,060GMC TSV export2026-02-10
Active variants (est.)~15,000-20,000Calculated2026-02-10
Avg variants per product~3.5Calculated2026-02-10

DR-02: GMC Custom Label Availability

LabelCurrent StateProducts UsingAvailable
custom_label_0“Argonaut Nations - Converting”7 of 124,060 (0.006%)Yes (safe to overwrite)
custom_label_1Empty0Yes
custom_label_2Empty0Yes
custom_label_3Empty0Yes
custom_label_4Empty0Yes

DR-03: GMC Custom Label Constraints

ConstraintValueAdPriority Impact
Labels available5 (label_0 through label_4)Full schema fits
Max characters per label value100All values under 30 characters
Max unique values per label1,000Max unique values used: ~20 (category group)
Total unique values (all labels)5,000~38 total unique values
Case sensitivityNot case-sensitiveUse lowercase for consistency
Shopper visibilityNot visible (internal only)No customer-facing impact

DR-04: Google Sheets Constraints

ConstraintValueAdPriority Impact
Maximum cells per spreadsheet10,000,0006 columns x 20,000 rows = 120,000 cells (1.2%)
Maximum rows per sheet5,000,000+20,000 rows (well within limit)
Maximum columns per sheet18,2786 columns used
Sheets API write quota300 requests per minuteBatch writes handle full catalog in 1-2 requests

DR-05: Product ID Format Verification

ComponentFormatExampleVerified
Full GMC product IDshopify_US_{productId}_{variantId}shopify_US_8779355160808_46050142748904Yes (124,060 products)
Item Group ID{productId}8779355160808Yes
Country codeUS for all Nexus productsUSYes
All IDs are variant-levelNo product-only IDs exist in GMCYes

2.8 Acceptance Criteria

MVP (Phase 0: Nexus Implementation)

#CriterionVerification Method
AC-01Priority scores assigned to all 2,425 active Nexus productsDatabase query: SELECT COUNT(*) WHERE priority_score IS NOT NULL
AC-02Supplemental feed (Google Sheet) created and connected to GMCGMC dashboard shows feed with 0 errors
AC-03Custom labels populated on all active variants in GMCGMC product search shows labels on random sample of 20 products
AC-04PMAX campaigns restructured by priority scoreGoogle Ads dashboard shows asset groups filtered by custom_label_0
AC-0530-day baseline ROAS documented before changeSpreadsheet with daily ROAS data for 30 days pre-deployment
AC-06Process documented for SaaS replicationStep-by-step guide covers: category mapping, scoring, feed generation, GMC connection

Beta Release (Phase 1)

#CriterionVerification Method
AC-10Shopify app installable via OAuthTest install on development store completes without errors
AC-11OAuth token exchange flow workingSession token validated, API requests succeed
AC-12Product import from Shopify workingImport 5,000 products in < 5 minutes
AC-13Basic priority UI functionalMerchant can view, search, filter, and edit product priorities
AC-14Manual GMC sync (Google Sheets) workingClick “Sync Now” updates Sheet within 60 seconds
AC-15GDPR webhooks implementedAll 3 mandatory endpoints return 200 OK
AC-165 beta testers onboarded5 real merchants have installed and used the app

Production Release (Phase 2-3)

#CriterionVerification Method
AC-20All subscription tiers functionalTest purchase on each tier succeeds
AC-21Automated GMC sync on scheduleSync runs at configured interval without manual intervention
AC-22Seasonal calendar auto-transitionsSimulated season boundary triggers recalculation
AC-23Rules engine UI completeMerchant can create, edit, test, and delete rules without code
AC-24New arrival boost workingProduct created today shows priority 5 in database
AC-25Shopify Billing API integrated14-day trial starts on install, converts to paid plan
AC-26App Store listing approvedPublished and discoverable on Shopify App Store
AC-27Onboarding flow completeNew merchant reaches first sync within 30 minutes

2.9 Constraints and Assumptions

Technical Constraints

ConstraintValueImpact on AdPriority
GMC custom label character limit100 characters per valueAll AdPriority values are < 30 characters
GMC unique values per label1,000 maximumAdPriority uses ~38 total unique values
GMC product update limit2x per day per product via Content APIDaily sync schedule is sufficient
Google Sheets cell limit10,000,000 cellsEven at 124K variants x 6 columns = 744K cells (7.4%)
Shopify API rate limit40 requests/second (REST), 1,000 points/second (GraphQL)Paginated import at 250 products/page stays within limits
Shopify metafield value limit512KB per metafieldAdPriority JSON payload is < 1KB
Shopify webhook deliveryAt-least-once (may deliver duplicates)Idempotent webhook handlers required

Platform Constraints

ConstraintImpact
Shopify requires embedded apps for new App Store submissionsMust use App Bridge v4+ and Polaris UI
Shopify deprecated cookie-based authenticationMust use session tokens (JWT)
GDPR webhooks are mandatoryThree endpoints must exist even if no customer data is stored
Shopify takes 20% revenue share on app subscriptionsPricing must account for this margin

Assumptions

AssumptionRisk if WrongMitigation
Merchants have a Google Merchant Center account with active product feedApp is useless without GMCOnboarding check verifies GMC account exists
Shopify Google Channel creates the primary product feedAdPriority adds supplemental labels onlyDocumentation explains this prerequisite
Merchants understand the concept of priority-based budget allocationLow adoption if concept is unclearOnboarding tutorial, help docs, video walkthrough
ROAS will improve with proper product segmentationCore value proposition failsPhase 0 validates with Nexus before building SaaS
Google Ads PMAX adoption continues growingMarket shrinks if PMAX declinesMonitor Google Ads product announcements

2.10 Out of Scope (v1.0)

The following features are explicitly excluded from version 1.0 and may be considered for future releases:

FeatureReason for ExclusionPotential Future Version
Multi-channel support (Facebook Ads, Microsoft/Bing Ads)Adds complexity without validated demand; Google Ads is the primary channelv2.0+
Automated bid managementAdPriority controls priorities, not bids; bid management is a separate product categoryNot planned
Creative optimization (ad copy, image selection)Outside core scope of product prioritizationNot planned
Inventory-based automation (auto-exclude when stock < N)Partially addressed by tag-based rules; full inventory integration deferredv1.5
Machine learning predictions (demand forecasting, score suggestions)Requires significant training data from multiple merchantsv2.0+
Mobile appEmbedded Polaris app works on mobile Shopify adminNot planned
Variant-level priority overridesProduct-level scoring is sufficient for v1.0; variant overrides add complexityv1.5
Multi-currency supportNexus is US-only; international stores may need localized pricingv2.0+
White-label / API accessEnterprise feature; requires additional infrastructurev2.0+ (Enterprise tier)
Campaign creation/managementAdPriority provides labels, not campaign management; merchants structure PMAX themselvesNot planned

2.11 Open Questions and Risks

Open Questions

#QuestionStatusResolution Path
OQ-01Variant-level vs. product-level priorities for v1.0?Resolved: Product-level for v1.0, variant-level for v1.5Variant-level in GMC feed (required), but priority is set at product level
OQ-02Optimal sync frequency vs. API rate limits?Resolved: Daily for Google Sheets (GMC fetches daily anyway)Content API (Pro) stays within 2x/day/product limit
OQ-03How to handle products not in GMC feed?OpenReconciliation job identifies unmatched IDs; exclude from supplemental feed with logged warning
OQ-04What GMC custom label slots are already in use for Nexus?Resolved: All 5 available (7 products on label_0, negligible)Safe to overwrite
OQ-05Pricing validation with target market?OpenValidate during beta with 5 testers; compare to competitor pricing
OQ-06How to handle stores with > 100K variants in Google Sheets?OpenSheet can handle 744K cells (7.4% of limit); Content API fallback for extreme cases
OQ-07Should seasonal transitions happen at midnight UTC or merchant timezone?Resolved: Merchant timezoneTimezone stored in store settings

Risks

RiskLikelihoodImpactMitigation
ROAS does not improve with priority-based segmentationMediumCritical – invalidates premisePhase 0 validates with real store before SaaS investment
GMC feed processing delays exceed 24 hoursLowMedium – delayed label applicationUse manual “Update” trigger in GMC; monitor processing times
Shopify API rate limits block large importsMediumMedium – slow initial setupImplement pagination, respect rate limit headers, use bulk GraphQL
Google Sheets API quota exceeded during bulk syncLowMedium – sync failureBatch writes, exponential backoff, manual CSV fallback
Competitor copies the priority scoring approachLowMedium – reduced differentiationFirst-mover advantage; build brand; add features competitors cannot easily replicate
Shopify App Store rejectionMediumHigh – blocks launchStudy requirements thoroughly; test against all criteria before submission
Seasonal transition applies wrong prioritiesMediumHigh – wrong products advertisedPreview mode before applying; manual override; monitor 48 hours after transition
Merchants find the rules engine too complexMediumHigh – adoption frictionPre-built templates; wizard-based onboarding; start simple, add complexity gradually

2.12 Requirement Traceability Matrix

This matrix maps each functional requirement to its implementation phase, source document, and related acceptance criteria.

Requirement IDDescriptionPhaseSourceAcceptance Criteria
FR-01Priority Score Definition0requirements.mdAC-01
FR-02Score Assignment Methods0-3requirements.mdAC-13
FR-03Score Override Hierarchy1category-mapping.mdAC-13
FR-10Category Rules1category-mapping.mdAC-13, AC-23
FR-11Rule Examples1category-mapping.mdAC-23
FR-20Product Identification0product-mapping.mdAC-02, AC-03
FR-21Custom Label Structure0product-mapping.md, google-merchant-center-api.mdAC-03
FR-30Season Definitions2seasonal-calendar.mdAC-22
FR-31Seasonal Rules2category-mapping.md, seasonal-calendar.mdAC-22
FR-40New Arrival Boost2requirements.mdAC-24
FR-50Sync Methods0-2google-merchant-center-api.mdAC-02, AC-14, AC-21
FR-51Sync Schedule1requirements.mdAC-14, AC-21
FR-52Error Handling1requirements.mdAC-14
FR-60Performance Data3google-ads-api.md
FR-61Recommendations3google-ads-api.md
IR-01App Installation1shopify-app-requirements.mdAC-10, AC-11
IR-02Data Access1shopify-app-requirements.mdAC-12
IR-03Webhooks1shopify-app-requirements.mdAC-15
IR-10GMC Authentication0-2google-merchant-center-api.mdAC-02
IR-11GMC API Operations2google-merchant-center-api.mdAC-21
IR-20Google Ads Authentication3google-ads-api.md
IR-21Google Ads API Operations3google-ads-api.md

Summary

This Product Requirements Document defines 21 functional requirements, 24 non-functional requirements, 11 integration requirements, and 5 UI/UX requirement areas for AdPriority. Every requirement traces back to the core problem: retailers waste ad spend by treating all products equally in Google Ads.

The requirements are organized by priority and phase:

  • Phase 0 (Week 1-2): Core scoring system (FR-01, FR-20, FR-21, FR-50) validated with Nexus Clothing
  • Phase 1 (Week 3-4): SaaS foundation (FR-02, FR-03, FR-10, FR-51, FR-52, IR-01 through IR-03) with 5 beta testers
  • Phase 2 (Week 5-8): Full product (FR-11, FR-30, FR-31, FR-40) with seasonal automation and rules engine
  • Phase 3 (Week 9-12): App Store launch (FR-60, FR-61, IR-20, IR-21) with billing and scale

Key technical decisions validated during the research phase:

  1. GMC product ID format: shopify_US_{productId}_{variantId} – confirmed from 124,060 product export
  2. All 5 custom labels available: Only 7 products use label_0 (0.006%), labels 1-4 are empty
  3. Supplemental feed pipeline works: 10/10 test products matched in GMC with zero errors
  4. Google Sheets capacity is sufficient: ~120,000 cells for Nexus (1.2% of 10M limit)

The next step is to use these requirements as the implementation guide for Phase 0 (Chapter 18) and the architectural foundation for the system design (Chapter 4).