Simple Agility Attribution RFC: Marketing Attribution & Sales Flywheel

Status: Draft Architectural RFC (SA-12) · Binds: Roller, Stockroom, JakeMon, simple-agility-accounting · Primary Hub: SimpleAgilityStackHub

This Request for Comments (RFC) establishes the architectural specification for cross-repository marketing attribution across the Simple Agility ecosystem. It defines how customer engagement on the sovereign blogging platform (RollerHub) is measured, correlated, and attributed to physical inventory transactions and revenue realized in the warehouse management system (StockroomIntakeInventoryPricingDesign) and settled in the general ledger (SimpleAgilityCommerceDataFlow).


1. The Multi-Channel Reselling Attribution Dilemma

In modern digital commerce, attribution is typically trivialized by uniform software stacks: an e-commerce storefront (e.g., Shopify, WooCommerce) injects Urchin Tracking Module (UTM) query parameters from an inbound landing page directly into a persistent visitor session cookie. When the customer submits a payment, the shopping cart writes those parameters (utm_source, utm_medium, utm_campaign) into the order record, which is emitted via webhook to the data warehouse.

The Simple Agility small-business architecture faces a fundamentally different structural challenge:

sequenceDiagram
    autonumber
    actor Reader as Customer / Collector
    participant Blog as Roller Fork (docker2)
    participant Umami as Umami Analytics (docker2)
    participant Mkt as Third-Party Channel (eBay / FBA)
    participant SR as Stockroom WMS (docker1)
    participant GL as Accounting Engine (GL)
    participant Dash as JakeMon Grafana (inference)

    Reader->>Blog: Visits spotlight post (/entry/vintage-leica-m3)
    Blog->>Umami: Records pageview (session_id, url_path)
    Reader->>Blog: Clicks [cta] "View Listing on eBay"
    Blog->>Umami: Emits cta-click (entry_anchor, dest=ebay.com)
    Blog-->>Mkt: Redirects to external listing (strips/ignores 3rd-party UTMs)
    Note over Reader,Mkt: Customer purchases item on eBay checkout
    Mkt->>SR: Ingests order via sell.fulfillment (SKU, price, line_id#59; NO UTMs!)
    SR->>GL: Emits ItemSold event (lacks marketing attribution)
    Note over Dash: Blind Spot: Umami sees clicks#59; Stockroom sees sales#59; No join key!

The Marketplace Walled Garden Invariant

  1. Third-Party Sanitization: External marketplaces such as eBay, Amazon, Mercari, and Poshmark act as strict walled gardens. When an external outbound link lands on ebay.com/itm/1234567890?utm_source=roller&utm_campaign=leica-m3, eBay’s checkout pipeline intentionally discards third-party UTM parameters.
  2. API Data Truncation: When Stockroom's background polling daemon queries eBay's sell.fulfillment REST API (GET /sell/fulfillment/v1/order), the returned JSON payload contains shipping fulfillment lines, buyer delivery addresses, SKU custom labels, and transaction amounts. It provides zero visibility into HTTP referrers, entry URLs, or external campaign identifiers.
  3. Local Classified Disconnect: Channels like Craigslist and Facebook Marketplace involve physical handshakes or direct messaging with no automated digital checkout pipeline whatsoever.

Without explicit architectural mechanisms, the ecosystem suffers from an attribution blind spot: Umami measures top-of-funnel reader interest and outbound click-throughs, while Stockroom measures bottom-of-funnel sales and gross margins, but neither product can programmatically verify whether the blog spotlight actually generated the sale.


2. Architectural Survey of Existing Stack Capabilities

The Simple Agility stack already possesses several key architectural primitives that make closed-loop attribution feasible without building heavy third-party tracking services:

flowchart TD
    subgraph Roller_Current["Roller Sovereign Platform"]
        CTA["CtaShortcode.java<br/>[cta] Tagging"]
        BOOK["BookingLink.java<br/>withUtmParams()"]
        FORM["roller_form_submission<br/>(entry_anchor, client_ip)"]
        REV["roller_event<br/>(FORM_SUBMITTED)"]
        CTA --> BOOK
        FORM --> REV
    end

    subgraph Telemetry_Current["Observability & Analytics"]
        UMAMI_DB[("Umami Postgres<br/>website_event")]
        VIEW["analytics_traffic View<br/>(path, entry_anchor, views)"]
        LOKI[("Loki Central Logs<br/>(ECS JsonTemplateLayout)")]
        UMAMI_DB --> VIEW
    end

    subgraph Stockroom_Current["Stockroom Inventory & WMS"]
        CL["channel_listing Table<br/>(item_id, external_id, url)"]
        SALE["sale Table<br/>(item_id, channel, price_cents)"]
        SYNC["EbaySellerAccount Port<br/>sell.fulfillment Poller"]
        CL --> SALE
        SYNC --> SALE
    end

    BOOK -.->|Appends UTMs & data-umami-event| UMAMI_DB
    SALE -.->|Emits ItemSold| LOKI

Component Inventory & Capabilities


3. The Four Concrete Attribution Vectors

To bridge the gap between Roller content and multi-channel inventory realization, this RFC defines four distinct attribution vectors:

Attribution VectorMechanismPrecisionInfrastructure OverheadPlatform Fee Impact
Vector 1: EPN Affiliate TagseBay Partner Network tracking links with customid100% Deterministic (Transaction Level)Low (Free EPN account + link generator)Positive: Reimburses 1% to 4% of sale value in affiliate credits
Vector 2: Store Coded CouponsTargeted discount codes embedded in articles (e.g., ROLLER5)100% Deterministic (Order Level)Very Low (Configured in eBay Seller Hub)Minor discount (5%) offset by higher conversion rate
Vector 3: Sovereign CheckoutDirect reader inquiries or Stripe Payment Links100% Deterministic (Ledger Level)Medium (Stripe Payment Link generation)Huge Win: Bypasses eBay's ~13.25% fee entirely
Vector 4: Single-SKU CorrelationTemporal heuristic matching Umami cta-click to Stockroom saleProbabilistic (~95% to 99%)Zero (SQL join in Grafana)Neutral
flowchart LR
    subgraph Vectors["Attribution Strategy Matrix"]
        V1["Vector 1: EPN Network<br/>customid=blog_slug_sku"]
        V2["Vector 2: Coded Coupon<br/>order.appliedPromotions"]
        V3["Vector 3: Sovereign Form<br/>roller_form_submission"]
        V4["Vector 4: Single-SKU Heuristic<br/>cta-click timestamp ~ sale"]
    end

    subgraph Targets["Target Channel"]
        EBAY["eBay Marketplace"]
        DIR["Direct Sovereign Sale"]
        LOCAL["Craigslist / Facebook"]
    end

    V1 --> EBAY
    V2 --> EBAY
    V3 --> DIR
    V4 --> EBAY
    V4 --> LOCAL

Vector 1: eBay Partner Network (EPN) Parameterization

eBay operates the eBay Partner Network (EPN), allowing publishers to generate tracked outbound URLs. EPN accepts a custom tracking parameter (customid) that persists through eBay's cart session:

https://www.ebay.com/itm/1234567890?mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5339000000&customid=roller_vintagefinds_rolleiflex-28f_1A2B3

Vector 2: Marketplace Coded Coupons

For sellers holding an eBay Store subscription, eBay supports Coded Coupons (public or private alphanumeric voucher codes, e.g., ROLLER5 or SPOTLIGHT10):

  1. The publisher agent (blogger-agent) embeds an exclusive promotional callout into the Roller entry body:

    Readers of Simple Agility can take an additional 5% off this camera at eBay checkout using code ROLLER5.

  2. When the buyer enters the code during eBay checkout, eBay validates and attaches the promotion to the order record.
  3. In eBay's sell.fulfillment API (GET /sell/fulfillment/v1/order/{orderId}), the order payload includes:
    {
      "orderId": "12-34567-89012",
      "pricingSummary": {
        "priceDiscount": {
          "value": "15.00",
          "currency": "USD"
        }
      },
      "appliedPromotions": [
        {
          "promotionId": "promo-987654",
          "description": "ROLLER5"
        }
      ]
    }
    
  4. Stockroom’s order sync extracts description and writes it to the sale record, establishing unambiguous attribution.

Vector 3: Sovereign Direct Checkout & Inquiry Forms

The highest-margin transaction occurs when an item is sold directly to a reader, circumventing marketplace commission fees.

Vector 4: Deterministic Single-Quantity SKU Temporal Heuristic

Because the reselling business manages unique, non-fungible inventory (e.g., a specific used book, an estate camera, a vintage precision tool), the inventory differs radically from bulk retail:


4. Proposed Database Schema and Event Extensions

To support attribution vectors 2, 3, and 4, the following data model extensions are proposed for future suite phases:

Stockroom Schema Migration (V028__add_attribution_to_sale.sql)

-- Migration: V028__add_attribution_to_sale.sql
-- Module: stockroom-persistence
-- Purpose: Support marketing attribution from Roller blog spotlights and promo codes

ALTER TABLE sale
    ADD COLUMN attribution_channel varchar(32),
    ADD COLUMN attribution_campaign varchar(255),
    ADD COLUMN promo_code varchar(64),
    ADD COLUMN attribution_confidence numeric(3,2);

COMMENT ON COLUMN sale.attribution_channel IS 'Source of marketing lead: roller_blog, newsletter, direct_inquiry, or null';
COMMENT ON COLUMN sale.attribution_campaign IS 'Originating blog entry_anchor or newsletter campaign ID';
COMMENT ON COLUMN sale.promo_code IS 'Marketplace coupon or voucher code applied at checkout';
COMMENT ON COLUMN sale.attribution_confidence IS 'Attribution confidence score between 0.00 and 1.00 (1.00 = coupon/direct form; 0.90 = single-SKU temporal)';

CREATE INDEX idx_sale_attribution ON sale (attribution_channel, attribution_campaign)
    WHERE attribution_channel IS NOT NULL;

Accounting Event Schema Extension (ItemSold)

In accordance with SimpleAgilityCommerceDataFlow, the immutable ItemSold event payload is expanded to carry optional attribution metadata:

{
  "event_id": "evt_01JAZ9876543210ABCDEFGHJK",
  "event_type": "ItemSold",
  "occurred_at": "2026-10-17T14:32:00Z",
  "actor": "system:ebay_sync",
  "data": {
    "item_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
    "sku": "1A2B3",
    "channel": "ebay",
    "gross_proceeds_cents": 30000,
    "channel_fees_cents": 4015,
    "net_cents": 25985,
    "attribution": {
      "channel": "roller_blog",
      "campaign": "vintage-rolleiflex-28f-review",
      "promo_code": "ROLLER5",
      "confidence": 1.00
    }
  }
}

5. Mathematical Modeling of Attribution Economics

Attribution telemetry is not merely an operational dashboard; it governs the allocation of marketing effort and channel selection.

1. Return on Content Investment (ROCI)

The financial justification for authoring deep-dive inventory spotlights is governed by the net profit generated above baseline content authoring costs:

\text{ROCI} = \frac{\sum_{i \in \text{Sales}} \left( \text{NetProceeds}_i - \text{COGS}_i \right) - \left( C_{\text{photo}} + C_{\text{authoring}} + C_{\text{infra}} \right)}{C_{\text{photo}} + C_{\text{authoring}} + C_{\text{infra}}}

Where:

2. Marketplace Arbitrage Margin Delta

When an attribution vector successfully steers a customer from an external marketplace to a direct sovereign transaction (Vector 3), the margin expansion is calculated as:

\Delta \text{Margin} = \left[ P_{\text{direct}} \times (1 - f_{\text{stripe}}) \right] - \left[ P_{\text{ebay}} \times (1 - f_{\text{ebay}}) - c_{\text{fvf\_fixed}} \right]

Concrete Numerical Example: Rare Estate Camera

Consider a rare estate camera priced at $300.00:

eBay Marketplace Sale (Vector 1 or 2):

Direct Sovereign Sale via Roller Inquiry / Stripe (Vector 3):

Arbitrage Benefit:

\Delta \text{Margin} = \$291.00 - \$259.85 = \$31.15

A direct transaction via the Roller blog preserves an additional $31.15 (10.38% of gross sale price) directly to the bottom line.


6. Implementation Phasing and Handoff Plan

To preserve development momentum while keeping systems strictly bounded, implementation of this RFC is phased across suite roadmaps:

flowchart TD
    P1["Phase 1: Zero-Code Observability (Immediate)"]
    P2["Phase 2: EPN & Coupon Operationalization (Near-Term)"]
    P3["Phase 3: Schema & Poller Integration (Future Suite Phase)"]

    P1 -->|Deploy Umami/Stockroom Grafana View| P2
    P2 -->|Blogger Agent generates EPN & Coupons| P3
    P3 -->|Stockroom V028 Migration & GL Ingestion| DONE["Closed-Loop Attribution Engine"]

Phase 1: Zero-Code Observability (No Code Changes)

Phase 2: EPN & Coded Coupon Operationalization

Phase 3: Automated Stockroom & Ledger Integration


See Also