Developer

Tracking, goals, targeting, preview, and harness

Generate tracking manifests, manage goals, test targeting, open QA previews, and publish AB Test Harness artifacts.

These command groups support measurement setup, live verification, targeting diagnostics, and external harness preview workflows.

Tracking manifests

bash
apex tracking inspect \
  https://example-store.test/products/example \
  https://checkout.example-store.test/thank-you \
  --shop-id 00000000-0000-4000-8000-000000000020 \
  --out ./.apex/tracking-manifest.json
 
apex tracking plan ./.apex/tracking-manifest.json
apex tracking qa ./.apex/tracking-manifest.json
CommandArgumentsFlagsBehavior
apex tracking inspect<urls...>--shop-id <id>, --endpoint <url>, --out <path>Writes a manifest with normalized URLs, domains, recommended cookie domain, snippet, handoff settings, placeholder steps/goals, and QA checks.
apex tracking plan[manifest]None beyond global flagsPrints the implementation plan from a manifest.
apex tracking qa[manifest]None beyond global flagsPrints the QA checklist from a manifest.
apex tracking verifyNone--minutes <n>, --limit <n>, --experiment <id>, --event-type <type>Reads recent live tracking events for the current shop.

apex tracking verify accepts comma-separated event types:

bash
apex tracking verify --minutes 120 --limit 20 --event-type pageview,purchase --json

Goals

bash
apex goals list --limit 50
 
apex goals create \
  --name "Add to cart click" \
  --type click \
  --selector "[data-add-to-cart]" \
  --count-once
 
apex goals update 00000000-0000-4000-8000-000000000030 \
  --event-name purchase_completed \
  --capture '[{"field":"order_id","source":"property","key":"order_id"}]'
CommandFlags
apex goals list--limit <n>
apex goals create--name <name>, --type <type>, --selector <selector>, --text-match <text>, --url-pattern <pattern>, --event-name <name>, --count-once, --capture <json-or-path>
apex goals update<id>, plus the same editable fields as create, with --no-count-once available.

Goal type values are click, pageview, custom, and revenue. Capture can be inline JSON or @path/to/capture.json.

Targeting tests

bash
apex targeting test https://example-store.test/products/example --status all
apex targeting test https://example-store.test/products/example --status draft,running --json

apex targeting test evaluates URL targeting for the supplied page and returns matching count, experiment rows, and caveats from the API.

QA preview URL

bash
apex preview homepage-hero-trust-copy
apex preview homepage-hero-trust-copy variant-a --store-url https://example-store.test/products/example --no-open

apex preview resolves the experiment by ID or slug, defaults to the first non-control variation, and builds a forced QA URL with drip_force, drip_experiment_id, drip_variation_id, drip_qa=1, and drip_debug=1. It opens the browser unless --no-open is present.

AB Test Harness

bash
apex harness init ./ab-test-harness/experiments/homepage-hero
apex harness dev ./ab-test-harness/experiments/homepage-hero --no-open
apex harness publish ./ab-test-harness/experiments/homepage-hero
CommandArgumentsFlagsBehavior
apex harness init<folder>--forceWrites apex.harness.json from existing harness metadata, unless it already exists.
apex harness dev<folder>--no-openRuns ab-harness build, uploads the artifact to an Apex harness session, opens or prints the preview URL, and watches for rebuilds.
apex harness publish<folder>None beyond global flagsRuns ab-harness verify, builds, uploads, and publishes the latest harness artifact to the Apex draft variation.

Set AB_HARNESS_BIN when the harness executable is not named ab-harness on PATH.