{
  "contract": "aisthetix-product-analytics",
  "version": 1,
  "schemaVersion": "1.0.0",
  "canonicalRepo": "aisthetix-shopify",
  "canonicalPath": "analytics/analytics-contract.v1.json",
  "description": "Single source of truth for the Aisthetix PostHog product analytics taxonomy. Copied verbatim into every consumer repo; `check:analytics-contract` fails when a copy diverges from the recorded hash.",
  "identity": {
    "merchant": {
      "shopify": {
        "distinctId": "shop",
        "note": "The myshopify domain. Never an email."
      },
      "woocommerce": {
        "distinctId": "accountId",
        "note": "The Core account id. storeId travels as a property, never as distinct id. Never an email."
      }
    },
    "shopper": {
      "shopify": {
        "distinctId": "clientId",
        "note": "Shopify Web Pixel clientId. Sent to the server only when Shopify analytics consent is granted."
      },
      "woocommerce": {
        "distinctId": "visitorKey",
        "note": "The plugin's first-party aisthetix_vid cookie. Falls back to an HMAC of the logged-in customer id when no visitorKey exists."
      },
      "fallback": {
        "distinctIdPrefix": "vk_",
        "algorithm": "hmac-sha256",
        "algorithmVersion": 1,
        "note": "Pseudonymous fallback derived server-side from a dedicated secret. A raw customer id is NEVER sent to PostHog."
      }
    },
    "rules": [
      "Merchant and shopper identities are never merged into one person.",
      "identify() is never called with email, name, address or phone.",
      "Shopper events set $process_person_profile=false: no person profile is created for an unidentified shopper."
    ]
  },
  "commonProperties": {
    "schemaVersion": {
      "type": "string",
      "required": true,
      "source": "contract"
    },
    "store": {
      "type": "string",
      "required": true,
      "source": "server",
      "note": "myshopify domain (Shopify) or Core storeId (WooCommerce)."
    },
    "platform": {
      "type": "enum",
      "enum": "platform",
      "required": true
    },
    "surface": {
      "type": "enum",
      "enum": "surface",
      "required": true
    },
    "environment": {
      "type": "enum",
      "enum": "environment",
      "required": true,
      "source": "server"
    },
    "appVersion": {
      "type": "string",
      "required": true
    },
    "locale": {
      "type": "string",
      "required": false
    },
    "plan": {
      "type": "string",
      "required": false,
      "source": "server"
    },
    "status": {
      "type": "string",
      "required": false,
      "source": "server"
    }
  },
  "enums": {
    "platform": ["shopify", "woocommerce"],
    "surface": ["merchant_admin", "storefront", "server"],
    "environment": ["production", "staging", "development"],
    "owner": ["client", "client-merchant", "server", "pixel-map"],
    "privacyClass": ["operational", "pseudonymous-shopper", "merchant-identified"],
    "adminPage": [
      "dashboard",
      "subscription",
      "usage",
      "analytics",
      "settings",
      "connect",
      "billing",
      "connection"
    ],
    "connectFailureReason": [
      "invalid_body",
      "missing_code",
      "invalid_site",
      "invalid_return_url",
      "return_url_host_mismatch",
      "connect_request_not_found",
      "connect_request_already_used",
      "invalid_or_used_code",
      "code_expired",
      "connect_state_invalid",
      "site_mismatch",
      "store_not_found",
      "unauthenticated",
      "exchange_failed",
      "unknown"
    ],
    "subscriptionCancelReason": ["merchant_cancelled", "payment_failed", "uninstalled", "expired", "frozen", "unknown"],
    "remainingBucket": ["lt_25_percent", "lt_10_percent", "lt_5", "exhausted"],
    "guideBasis": ["body", "garment", "unknown"],
    "parseResult": ["ok", "unusable", "unparsable", "unavailable"],
    "targetKind": ["product_type", "collection", "tag", "product_id", "all"],
    "coverageStatus": ["full", "partial", "none", "unknown"],
    "targetingMode": ["all", "include", "exclude"],
    "targetingFeature": ["tryon", "size"],
    "placement": ["button_block", "widget_block", "shortcode", "gutenberg_block", "elementor", "auto", "unknown"],
    "targetMode": ["all", "include", "exclude"],
    "photoSource": ["upload", "saved"],
    "tryonProvider": ["gemini", "seedream", "unknown"],
    "tryonStage": ["quota", "photo", "upload", "inference", "render", "unknown"],
    "tryonFailureReason": [
      "network",
      "timeout",
      "image_load_failed",
      "provider_error",
      "provider_refused",
      "invalid_photo",
      "payload_too_large",
      "rate_limited",
      "engine_unavailable",
      "unexpected"
    ],
    "tryonBlockedReason": [
      "no_subscription",
      "quota_exhausted",
      "trial_exhausted",
      "free_tier_exhausted",
      "subscription_inactive",
      "visitor_rate_limited",
      "store_rate_limited",
      "store_revoked",
      "store_suspended",
      "unknown"
    ],
    "modalPhase": [
      "idle",
      "checking_quota",
      "avatar_upload",
      "processing",
      "completed",
      "error",
      "blocked",
      "size"
    ],
    "sizeQcReason": [
      "no_person_detected",
      "multiple_people",
      "partial_body",
      "too_dark",
      "too_blurry",
      "face_only",
      "unsupported_pose",
      "unknown"
    ],
    "sizeFailureReason": [
      "photo_unusable",
      "size_guide_not_usable",
      "size_guide_not_applicable",
      "engine_unavailable",
      "timeout",
      "invalid_input",
      "unreachable",
      "unreadable_response",
      "unexpected"
    ],
    "confidenceBand": ["low", "good", "very_confident"],
    "guideResolution": ["product_type", "collection", "tag", "shop_default", "none"],
    "refinementKind": ["weight", "photo"],
    "onboardingStep": ["install", "scopes", "widget_placement", "size_guide", "targeting", "plan", "first_tryon"],
    "consentDecision": ["granted", "denied", "unknown"]
  },
  "privacy": {
    "deniedKeySubstrings": [
      "image",
      "photo",
      "picture",
      "avatar",
      "thumbnail",
      "height",
      "weight",
      "measurement",
      "bust",
      "waist",
      "hip",
      "inseam",
      "chest",
      "email",
      "mail",
      "phone",
      "address",
      "token",
      "secret",
      "password",
      "apikey",
      "api_key",
      "authorization",
      "credential",
      "prompt",
      "session",
      "cookie",
      "query",
      "querystring",
      "search",
      "fragment",
      "hash",
      "referrer",
      "referer",
      "ipaddress",
      "clientip",
      "remoteaddr",
      "useragent",
      "user_agent"
    ],
    "deniedValuePatterns": [
      "^data:",
      "^blob:",
      "^-----BEGIN",
      "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}",
      "^(?:\\d{1,3}\\.){3}\\d{1,3}$",
      "^(?:[0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}$"
    ],
    "deniedKeyExceptions": ["hasSavedPhoto", "hasWeight"],
    "deniedKeyExceptionRule": "An excepted key MUST be declared `boolean` on every event that carries it. These two are presence flags \u2014 whether a saved photo existed, whether a weight was given \u2014 and can never carry the value the substring screen is protecting. A key that is not boolean cannot be excepted.",
    "urlShape": "origin+pathname",
    "maxStringLength": 256,
    "maxProperties": 40,
    "notes": [
      "Property allowlist is per event: anything not declared required/optional in this contract is dropped server-side.",
      "The denied-key screen is a second, independent net applied to every payload, including allowlisted keys.",
      "URLs are reduced to origin + pathname. Query string, fragment and raw referrer never reach PostHog.",
      "Raw error messages never become property values; every reason is mapped to an enum member declared here."
    ]
  },
  "delivery": {
    "criticalTransport": "mongo-outbox",
    "bestEffortTransport": "direct-capture",
    "insertIdRule": "$insert_id is always the outbox eventId, which is deterministic for the event's natural key (see each event's insertIdKey). Retries therefore de-duplicate in PostHog.",
    "insertIdAlgorithm": "sha256(contractVersion + '|' + eventName + '|' + join(insertIdKey values, '|')) truncated to 32 hex chars, prefixed 'ax1_'",
    "maxAttempts": 8,
    "backoffBaseMs": 5000,
    "backoffMaxMs": 3600000,
    "leaseMs": 60000,
    "batchSize": 50,
    "deliveredTtlSeconds": 604800
  },
  "events": {
    "merchant_app_installed": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "firstOnly": true,
      "milestone": "app_installed",
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "milestone"],
      "required": {
        "store": "string",
        "platform": "enum:platform"
      },
      "optional": {
        "plan": "string",
        "status": "string"
      }
    },
    "merchant_connect_started": {
      "owner": "client-merchant",
      "platforms": ["woocommerce"],
      "surfaces": ["merchant_admin"],
      "critical": false,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId"],
      "required": {
        "platform": "enum:platform"
      },
      "optional": {
        "runId": "string"
      }
    },
    "merchant_connect_approved": {
      "owner": "server",
      "platforms": ["woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["storeId", "connectRequestId"],
      "required": {
        "storeId": "string"
      },
      "optional": {
        "connectRequestId": "string",
        "reconnect": "boolean"
      }
    },
    "merchant_connect_failed": {
      "owner": "server",
      "platforms": ["woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "reason", "occurredAtMinute"],
      "required": {
        "reason": "enum:connectFailureReason"
      },
      "optional": {
        "storeId": "string",
        "stage": "string"
      }
    },
    "merchant_scopes_granted": {
      "owner": "server",
      "platforms": ["shopify"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "scopesFingerprint"],
      "required": {
        "scopes": "string[]",
        "missingScopes": "string[]"
      },
      "optional": {
        "scopesFingerprint": "string"
      }
    },
    "merchant_admin_opened": {
      "owner": "client-merchant",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["merchant_admin"],
      "critical": false,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "page", "runId"],
      "required": {
        "page": "enum:adminPage"
      },
      "optional": {
        "runId": "string"
      }
    },
    "merchant_onboarding_started": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "flowVersion"],
      "required": {
        "flowVersion": "string"
      },
      "optional": {},
      "note": "Derived server-side from the first onboarding milestone a shop claims. There is no onboarding wizard in either admin, and inventing one to satisfy a taxonomy would be the wrong way round \u2014 the steps are already observable."
    },
    "merchant_onboarding_step_completed": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "step", "flowVersion"],
      "required": {
        "step": "enum:onboardingStep"
      },
      "optional": {
        "durationMs": "number",
        "flowVersion": "string"
      },
      "note": "Derived server-side from the milestone each step claims."
    },
    "merchant_onboarding_skipped": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "step", "flowVersion"],
      "required": {
        "step": "enum:onboardingStep"
      },
      "optional": {
        "flowVersion": "string"
      },
      "note": "INFERRED, not clicked: a merchant who reaches a later step having never completed an optional earlier one has skipped it. Nobody clicks skip; they just never upload a size guide, and then conclude the size feature does not work."
    },
    "merchant_widget_configured": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "placement", "targetMode", "settingsRevision"],
      "required": {
        "placement": "enum:placement",
        "targetMode": "enum:targetMode"
      },
      "optional": {
        "settingsRevision": "string",
        "enabled": "boolean"
      }
    },
    "merchant_size_guide_uploaded": {
      "owner": "server",
      "platforms": ["shopify"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "guideId", "parseResult"],
      "required": {
        "guideId": "string",
        "guideBasis": "enum:guideBasis",
        "parseResult": "enum:parseResult"
      },
      "optional": {
        "rowCount": "number",
        "labelCount": "number"
      }
    },
    "merchant_size_guide_assigned": {
      "owner": "server",
      "platforms": ["shopify"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "guideId", "targetKind", "settingsRevision"],
      "required": {
        "guideId": "string",
        "targetKind": "enum:targetKind",
        "coverageStatus": "enum:coverageStatus"
      },
      "optional": {
        "targetCount": "number",
        "settingsRevision": "string"
      }
    },
    "merchant_targeting_changed": {
      "owner": "server",
      "platforms": ["shopify"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "feature", "mode", "settingsRevision"],
      "required": {
        "feature": "enum:targetingFeature",
        "mode": "enum:targetingMode"
      },
      "optional": {
        "categoryCount": "number",
        "productIdCount": "number",
        "settingsRevision": "string"
      }
    },
    "merchant_first_tryon_served": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "firstOnly": true,
      "milestone": "first_tryon_served",
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "milestone"],
      "required": {
        "daysSinceInstall": "number"
      },
      "optional": {
        "plan": "string"
      }
    },
    "merchant_subscription_started": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "plan", "subscriptionRef"],
      "required": {
        "plan": "string",
        "trial": "boolean"
      },
      "optional": {
        "subscriptionRef": "string",
        "trialDays": "number"
      }
    },
    "merchant_subscription_activated": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "plan", "subscriptionRef"],
      "required": {
        "plan": "string"
      },
      "optional": {
        "subscriptionRef": "string",
        "trial": "boolean"
      }
    },
    "merchant_subscription_cancelled": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "plan", "subscriptionRef", "reason"],
      "required": {
        "plan": "string",
        "reason": "enum:subscriptionCancelReason"
      },
      "optional": {
        "subscriptionRef": "string"
      }
    },
    "merchant_quota_warning_reached": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "firstOnly": true,
      "milestone": "quota_warning:{remainingBucket}:{periodKey}",
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "remainingBucket", "periodKey"],
      "required": {
        "remainingBucket": "enum:remainingBucket"
      },
      "optional": {
        "plan": "string",
        "periodKey": "string"
      }
    },
    "merchant_quota_exhausted": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "firstOnly": true,
      "milestone": "quota_exhausted:{periodKey}",
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "periodKey"],
      "required": {
        "plan": "string",
        "status": "string"
      },
      "optional": {
        "periodKey": "string"
      }
    },
    "merchant_disconnected": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "merchant-identified",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "occurredAtMinute"],
      "required": {
        "platform": "enum:platform"
      },
      "optional": {
        "plan": "string"
      }
    },
    "tryon_modal_opened": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "productId", "openIndex"],
      "required": {
        "productId": "string",
        "hasSavedPhoto": "boolean"
      },
      "optional": {
        "placement": "enum:placement",
        "runId": "string",
        "openIndex": "number"
      }
    },
    "tryon_photo_selected": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "requestId"],
      "required": {
        "source": "enum:photoSource"
      },
      "optional": {
        "productId": "string",
        "runId": "string",
        "requestId": "string"
      }
    },
    "tryon_requested": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "productId": "string",
        "requestId": "string"
      },
      "optional": {
        "attempt": "number",
        "runId": "string"
      }
    },
    "tryon_completed": {
      "owner": "pixel-map",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "productId": "string",
        "requestId": "string",
        "durationMs": "number",
        "provider": "enum:tryonProvider",
        "cached": "boolean"
      },
      "optional": {
        "runId": "string"
      }
    },
    "tryon_failed": {
      "owner": "pixel-map",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "requestId": "string",
        "reason": "enum:tryonFailureReason",
        "stage": "enum:tryonStage",
        "retryable": "boolean"
      },
      "optional": {
        "productId": "string",
        "durationMs": "number",
        "runId": "string"
      }
    },
    "tryon_blocked": {
      "owner": "server",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["server"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "shopperRef", "reason", "occurredAtMinute"],
      "required": {
        "reason": "enum:tryonBlockedReason",
        "status": "string"
      },
      "optional": {
        "productId": "string",
        "plan": "string"
      }
    },
    "tryon_result_viewed": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "requestId": "string",
        "timeToViewMs": "number"
      },
      "optional": {
        "productId": "string",
        "runId": "string"
      }
    },
    "tryon_result_dismissed": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId", "phase"],
      "required": {
        "requestId": "string",
        "dwellMs": "number",
        "phase": "enum:modalPhase"
      },
      "optional": {
        "productId": "string",
        "runId": "string"
      }
    },
    "tryon_retry_requested": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "attempt"],
      "required": {
        "reason": "enum:tryonFailureReason",
        "attempt": "number"
      },
      "optional": {
        "productId": "string",
        "runId": "string"
      }
    },
    "tryon_added_to_cart": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "variantId", "requestId"],
      "required": {
        "productId": "string",
        "variantId": "string",
        "recommendedSizeUsed": "boolean"
      },
      "optional": {
        "requestId": "string",
        "runId": "string"
      }
    },
    "tryon_modal_closed": {
      "owner": "client",
      "platforms": ["shopify", "woocommerce"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "openIndex"],
      "required": {
        "phase": "enum:modalPhase",
        "dwellMs": "number"
      },
      "optional": {
        "productId": "string",
        "runId": "string",
        "openIndex": "number"
      }
    },
    "size_offer_shown": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "productId"],
      "required": {
        "productId": "string",
        "guideResolution": "enum:guideResolution"
      },
      "optional": {
        "runId": "string"
      }
    },
    "size_offer_accepted": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "productId"],
      "required": {
        "productId": "string"
      },
      "optional": {
        "runId": "string"
      }
    },
    "size_photo_qc_completed": {
      "owner": "pixel-map",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "productId", "qcIndex"],
      "required": {
        "ok": "boolean"
      },
      "optional": {
        "reason": "enum:sizeQcReason",
        "productId": "string",
        "runId": "string",
        "qcIndex": "number"
      }
    },
    "size_inputs_submitted": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "productId", "submitIndex"],
      "required": {
        "hasWeight": "boolean"
      },
      "optional": {
        "productId": "string",
        "runId": "string",
        "submitIndex": "number"
      }
    },
    "size_estimation_requested": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "requestId": "string",
        "hasWeight": "boolean"
      },
      "optional": {
        "productId": "string",
        "runId": "string"
      }
    },
    "size_estimation_completed": {
      "owner": "pixel-map",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "requestId": "string",
        "recommendedSize": "string",
        "confidenceBand": "enum:confidenceBand",
        "cacheHit": "boolean"
      },
      "optional": {
        "productId": "string",
        "betweenSizes": "boolean",
        "durationMs": "number",
        "runId": "string"
      }
    },
    "size_estimation_failed": {
      "owner": "pixel-map",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": true,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "requestId"],
      "required": {
        "requestId": "string",
        "reason": "enum:sizeFailureReason",
        "retryable": "boolean"
      },
      "optional": {
        "productId": "string",
        "durationMs": "number",
        "runId": "string"
      }
    },
    "size_refinement_requested": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "kind", "refineIndex"],
      "required": {
        "kind": "enum:refinementKind"
      },
      "optional": {
        "productId": "string",
        "runId": "string",
        "refineIndex": "number"
      }
    },
    "size_recommended_variant_selected": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "variantId"],
      "required": {
        "recommendedSize": "string",
        "variantId": "string"
      },
      "optional": {
        "productId": "string",
        "runId": "string",
        "shopperOverrode": "boolean"
      }
    },
    "size_recommended_variant_added_to_cart": {
      "owner": "client",
      "platforms": ["shopify"],
      "surfaces": ["storefront"],
      "critical": false,
      "privacyClass": "pseudonymous-shopper",
      "minAppVersion": "1.1.0",
      "insertIdKey": ["store", "runId", "variantId"],
      "required": {
        "recommendedSize": "string",
        "variantId": "string"
      },
      "optional": {
        "productId": "string",
        "runId": "string"
      }
    }
  },
  "pixelMap": {
    "aisthetix_tryon_completed": "tryon_completed",
    "aisthetix_tryon_failed": "tryon_failed",
    "aisthetix_size_qc": "size_photo_qc_completed",
    "aisthetix_size_completed": "size_estimation_completed",
    "aisthetix_size_failed": "size_estimation_failed",
    "aisthetix_product_analytics": "*"
  },
  "singleEmitter": {
    "tryon_completed": "pixel-map only \u2014 the widget publishes the Shopify custom event; the server maps it once. No client capture, no second server capture.",
    "tryon_failed": "pixel-map only.",
    "size_photo_qc_completed": "pixel-map only.",
    "size_estimation_completed": "pixel-map only.",
    "size_estimation_failed": "pixel-map only.",
    "tryon_blocked": "server only \u2014 emitted where the quota decision is made."
  }
}
