mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 11:45:23 +02:00
Add complete Experiments tracking system
New Features: - Experiments tab with full CRUD operations - Create experiments by ASIN or product line groups - Track pricing, advertising, content, and promotion experiments - Performance analytics with baseline vs experiment comparison - Visual experiment badges in Weekly Sales grid - Experiment detail view with metrics and learnings Technical Changes: - Add Supabase experiments table migration - New services/experiments.ts for CRUD + calculations - New components: ExperimentsView, ExperimentDetail, ExperimentForm, ExperimentBadge - Integrate experiment indicators in WeeklyGrid - Add navigation tab (desktop + mobile) - Type definitions in types.ts Usage: 1. Run SQL migration in Supabase 2. Navigate to Experiments tab 3. Create experiments with ASINs, dates, hypothesis 4. View performance lift after completion 5. See active experiments marked in Weekly Sales Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
co-authored by
Qwen-Coder
parent
a4919691b2
commit
f93d92da0b
@@ -279,3 +279,75 @@ export interface VendorCSVRow {
|
||||
'Amazon Has Buybox': string;
|
||||
'Glance Views': string;
|
||||
}
|
||||
|
||||
// Experiment Tracking Types
|
||||
export type ExperimentType = 'pricing' | 'advertising' | 'content' | 'promotion';
|
||||
export type ExperimentStatus = 'planned' | 'active' | 'completed' | 'paused';
|
||||
export type ExperimentMetric = 'units' | 'revenue' | 'acos' | 'ctr' | 'cvr' | 'bsr';
|
||||
|
||||
export interface Experiment {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
type: ExperimentType;
|
||||
status: ExperimentStatus;
|
||||
asins: string[];
|
||||
marketplace: string;
|
||||
start_date: string;
|
||||
end_date?: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
hypothesis?: string;
|
||||
primary_metric: ExperimentMetric;
|
||||
target_lift_percent?: number;
|
||||
|
||||
// Results
|
||||
baseline_units?: number;
|
||||
baseline_revenue?: number;
|
||||
experiment_units?: number;
|
||||
experiment_revenue?: number;
|
||||
actual_lift_percent?: number;
|
||||
statistical_significance?: number;
|
||||
|
||||
learnings?: string;
|
||||
owner?: string;
|
||||
}
|
||||
|
||||
export interface ExperimentCreateInput {
|
||||
name: string;
|
||||
description?: string;
|
||||
type: ExperimentType;
|
||||
asins: string[];
|
||||
marketplace: string;
|
||||
start_date: string;
|
||||
end_date?: string;
|
||||
hypothesis?: string;
|
||||
primary_metric: ExperimentMetric;
|
||||
target_lift_percent?: number;
|
||||
owner?: string;
|
||||
}
|
||||
|
||||
export interface ExperimentListItem {
|
||||
id: string;
|
||||
name: string;
|
||||
type: ExperimentType;
|
||||
status: ExperimentStatus;
|
||||
asin_count: number;
|
||||
marketplace: string;
|
||||
start_date: string;
|
||||
end_date?: string;
|
||||
progress_percent: number;
|
||||
actual_lift_percent?: number;
|
||||
owner?: string;
|
||||
}
|
||||
|
||||
export interface ActiveExperiment {
|
||||
asin: string;
|
||||
experiment_id: string;
|
||||
experiment_name: string;
|
||||
type: ExperimentType;
|
||||
status: ExperimentStatus;
|
||||
start_date: string;
|
||||
end_date?: string;
|
||||
days_remaining?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user