Sync campaign orders and backfill Tableau data through Oct 7

This commit is contained in:
Codex
2026-10-08 12:38:05 +08:00
parent e5d476454e
commit 1653829f60
4 changed files with 119 additions and 20 deletions
+111 -15
View File
@@ -387,7 +387,7 @@
"pkg": "com.yandex.bank",
"adping_id": "11078963",
"group": "实验组",
"owner": "詹涵粤",
"owner": "周梓君",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -399,7 +399,7 @@
"pkg": "com.yandex.bank",
"adping_id": "2937658",
"group": "对照组",
"owner": "詹涵粤",
"owner": "周梓君",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -483,7 +483,7 @@
"pkg": "ru.kinopoisk",
"adping_id": "8291713",
"group": "对照组",
"owner": "万科",
"owner": "周梓君",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -615,7 +615,7 @@
"pkg": "com.esprit.rpg.cntrctfft",
"adping_id": "11715627",
"group": "实验组",
"owner": "",
"owner": "黄政",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -627,7 +627,7 @@
"pkg": "com.esprit.rpg.cntrctfft",
"adping_id": "9311355",
"group": "对照组",
"owner": "",
"owner": "黄政",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -687,7 +687,7 @@
"pkg": "com.uma.musicvk",
"adping_id": "11690183",
"group": "实验组",
"owner": "",
"owner": "万科",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -699,7 +699,7 @@
"pkg": "com.uma.musicvk",
"adping_id": "2783561",
"group": "对照组",
"owner": "",
"owner": "万科",
"geo": "RU",
"platform": "MTG",
"status": "Active",
@@ -831,7 +831,7 @@
"pkg": "com.king.candycrushsaga",
"adping_id": "91407542",
"group": "对照组",
"owner": "",
"owner": "万科",
"geo": "ID",
"platform": "MTG",
"status": "Pause",
@@ -843,7 +843,7 @@
"pkg": "com.king.candycrushsaga",
"adping_id": "91535229",
"group": "实验组",
"owner": "",
"owner": "万科",
"geo": "ID",
"platform": "MTG",
"status": "Active",
@@ -908,7 +908,7 @@
"platform": "MTG",
"status": "Active",
"kpi": "singup",
"remark": "",
"remark": "0904新上",
"channel": "mintegral"
},
{
@@ -920,7 +920,7 @@
"platform": "MTG",
"status": "Active",
"kpi": "singup",
"remark": "",
"remark": "0904新上",
"channel": "mintegral"
},
{
@@ -944,7 +944,7 @@
"platform": "MTG",
"status": "Active",
"kpi": "af_purchase",
"remark": "",
"remark": "0908新上",
"channel": "mintegral"
},
{
@@ -956,7 +956,7 @@
"platform": "MTG",
"status": "Active",
"kpi": "af_purchase",
"remark": "",
"remark": "0908新上",
"channel": "mintegral"
},
{
@@ -968,7 +968,7 @@
"platform": "MTG",
"status": "Active",
"kpi": "af_purchase",
"remark": "",
"remark": "0908新上",
"channel": "mintegral"
},
{
@@ -992,7 +992,103 @@
"platform": "Kwai",
"status": "Active",
"kpi": "event1",
"remark": "0912新上",
"remark": "",
"channel": "kwai"
},
{
"pkg": "com.king.candycrushsodasaga",
"adping_id": "12064281",
"group": "实验组",
"owner": "黄政",
"geo": "DE",
"platform": "MTG",
"status": "Active",
"kpi": "af_purchase",
"remark": "",
"channel": "mintegral"
},
{
"pkg": "com.king.candycrushsodasaga",
"adping_id": "6951594",
"group": "对照组",
"owner": "黄政",
"geo": "DE",
"platform": "MTG",
"status": "Active",
"kpi": "af_purchase",
"remark": "",
"channel": "mintegral"
},
{
"pkg": "com.amazon.mShop.android.shopping",
"adping_id": "5619156",
"group": "实验组",
"owner": "黄政",
"geo": "SA",
"platform": "BIGO",
"status": "Active",
"kpi": "event1",
"remark": "",
"channel": "bigo"
},
{
"pkg": "com.yandex.lavka",
"adping_id": "12425335",
"group": "实验组",
"owner": "黄政",
"geo": "RU",
"platform": "MTG",
"status": "Active",
"kpi": "first_successful_purchase_lavka_to_lvkapp",
"remark": "",
"channel": "mintegral"
},
{
"pkg": "com.yandex.lavka",
"adping_id": "8156506",
"group": "对照组",
"owner": "黄政",
"geo": "RU",
"platform": "MTG",
"status": "Active",
"kpi": "first_successful_purchase_lavka_to_lvkapp",
"remark": "",
"channel": "mintegral"
},
{
"pkg": "ru.rt.video.app.mobile",
"adping_id": "12011132",
"group": "对照组",
"owner": "周梓君",
"geo": "RU",
"platform": "MTG",
"status": "Active",
"kpi": "",
"remark": "",
"channel": "mintegral"
},
{
"pkg": "ru.rt.video.app.mobile",
"adping_id": "12542512",
"group": "实验组",
"owner": "周梓君",
"geo": "RU",
"platform": "MTG",
"status": "Active",
"kpi": "",
"remark": "0922新上",
"channel": "mintegral"
},
{
"pkg": "asrtum.ent.domovyata",
"adping_id": "12522893",
"group": "实验组",
"owner": "黄政",
"geo": "RU",
"platform": "Lacuna",
"status": "",
"kpi": "",
"remark": "",
"channel": "lacuna"
}
]
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -39,7 +39,7 @@
<div class="panel chart"><div class="chart-head"><div><div class="title">每日趋势</div><div class="chart-sub">左轴:Spend(USD) · 右轴:Conversions</div></div><div class="legend"><button id="toggleSpend" aria-pressed="true"><i class="dot" style="background:#1769e0"></i>Spend</button><button id="toggleConversions" aria-pressed="true"><i class="dot" style="background:#16825d"></i>Conversions</button></div></div><svg id="trend" viewBox="0 0 900 270"></svg><div class="tooltip" id="trendTip"></div></div>
</section>
<section class="panel table-panel"><div class="table-head"><div class="title" style="margin:0">Detail</div><div class="table-note" id="count"></div></div><div class="table-wrap"><table><thead><tr><th>Date</th><th>组别</th><th>Campaign name</th><th>KPI Event</th><th class="num">Event</th><th class="num">Spend</th><th class="num">CAC</th><th class="num">Impression</th><th class="num">Click</th><th class="num">Conversions</th><th class="num">CTR</th><th class="num">CVR</th><th class="num">CPI</th></tr></thead><tbody id="body"></tbody></table></div></section>
<div class="foot">数据源:Tableau · DSP Daily Data。订单状态以 Campaign info 的 G 列为准,KPI Event 以 I 列为准;I 列为“-”时不追踪事件质量。实验组通过 Campaign name 中的 adping ID 识别;同一 pkg、GEO、Platform 下,其余 Campaign 合并为对照组并显示为 General campaign。CAC = Spend / KPI Event,CPI = Spend / Install;比率均使用汇总后的分子与分母重新计算。</div>
<div class="foot">数据源:Tableau · DSP Daily Data。订单状态以 Campaign info 的 G 列为准,KPI Event 以 I 列为准;I 列为“-”时不追踪事件质量。实验组通过 Campaign name 中的 adping ID 识别;同一 pkg、GEO、Platform 下,其余 Campaign 合并为对照组并显示为 General campaign。事件仅在事件源覆盖且与原始 Campaign、KPI 事件精确匹配时展示,缺失显示“—”,不按 0 计算。CAC = 有事件覆盖的 Spend / KPI Event,CPI = Spend / Install;比率均使用汇总后的分子与分母重新计算。</div>
</main><script>
const $=id=>document.getElementById(id); let all=[],campaignConfig=[],lastRows=[],trendVisible={spend:true,conversions:true};
const n=(v,d=0)=>Number(v||0).toLocaleString('en-US',{minimumFractionDigits:d,maximumFractionDigits:d});
+6 -3
View File
@@ -91,6 +91,7 @@ for raw_row in matrix[1:] if has_header else matrix:
campaign = cell(raw_row, 'campaign').strip()
if not pkg or not source or not campaign: continue
date = cell(raw_row, 'date').strip() or target
if date != target: continue
exp = next((meta for adping, meta in experiment.get((pkg, source), [])
if re.search(r'(?<!\d)' + re.escape(adping) + r'(?!\d)', campaign)), None)
if not exp:
@@ -108,11 +109,13 @@ for raw_row in matrix[1:] if has_header else matrix:
if not active_on(meta, date):
continue
required = event_names(meta.get('kpi',''))
if not required or (date, source) not in covered_scopes:
matched_events = [(date, pkg, source, campaign, name) for name in required
if (date, pkg, source, campaign, name) in events]
if not required or (date, source) not in covered_scopes or not matched_events:
event = None
else:
event = sum(events.get((date, pkg, source, campaign, name), 0) for name in required)
rows.append({'date': cell(raw_row, 'date').strip() or target, 'pkg':pkg, 'geo':meta['geo'], 'source':source,
event = sum(events[key] for key in matched_events)
rows.append({'date': date, 'pkg':pkg, 'geo':meta['geo'], 'source':source,
'group':group, 'adpingId':adping, 'campaign':shown, 'status':'Active', 'kpi':meta.get('kpi',''),
'event':event,
'impression':num(cell(raw_row,'impression')), 'click':num(cell(raw_row,'click')),