perf: creatividades warehouse-first + aviso OAuth Ads Production
Carga métricas desde ad_daily al instante (mode=fast) y enriquece previews en vivo; la UI de Agencia avisa si falta scope Ads o consent Testing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -217,6 +217,22 @@ function cardsFromDaily(
|
||||
}));
|
||||
}
|
||||
|
||||
/** Warehouse-only Google cards (fast path). */
|
||||
export function buildGoogleCardsFromDaily(
|
||||
dailyRows: Parameters<typeof aggregateDailyByAd>[0],
|
||||
since: string,
|
||||
until: string,
|
||||
limit = 24
|
||||
): AdCreativeCard[] {
|
||||
return cardsFromDaily(
|
||||
dailyRows,
|
||||
since,
|
||||
until,
|
||||
limit,
|
||||
'Métricas desde warehouse (sync Ads)'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Live Google creatives: Performance Max asset groups + RSA/RDA ads.
|
||||
* Always falls back to ad_daily campaign cards when the API/token fails.
|
||||
|
||||
@@ -317,6 +317,15 @@ function cleanMetaAdName(name: string): string {
|
||||
}
|
||||
|
||||
/** Campaign-level cards from warehouse — always available, never throws. */
|
||||
export function buildMetaWarehouseCards(
|
||||
dailyRows: Parameters<typeof aggregateDailyByAd>[0],
|
||||
since: string,
|
||||
until: string,
|
||||
limit = 16
|
||||
): AdCreativeCard[] {
|
||||
return metaCardsFromDaily(dailyRows, since, until, limit);
|
||||
}
|
||||
|
||||
function metaCardsFromDaily(
|
||||
dailyRows: Parameters<typeof aggregateDailyByAd>[0],
|
||||
since: string,
|
||||
|
||||
Reference in New Issue
Block a user