init: moboos ad report

This commit is contained in:
王源
2026-08-24 22:46:38 +08:00
commit 46851ef3c2
4 changed files with 363 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
[
{"date":"2026-08-17","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":40311,"clicks":542,"conversions":23,"ecpm":0.285,"cpc":0.021,"ctr":0.01345,"ivr":0.00057,"cvr":0.04244},
{"date":"2026-08-17","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":85696,"clicks":19376,"conversions":19,"ecpm":0.1,"cpc":0,"ctr":0.2261,"ivr":0.00022,"cvr":0.00098},
{"date":"2026-08-17","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":9943,"clicks":343,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.0345,"ivr":0,"cvr":0},
{"date":"2026-08-17","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":21829,"clicks":1998,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.09153,"ivr":0,"cvr":0},
{"date":"2026-08-17","pkg":"br.com.netshoes.app","ad_unit":"91530549_Netshoes_BR","impressions":4,"clicks":0,"conversions":0,"ecpm":0,"cpc":0,"ctr":0,"ivr":0,"cvr":0},
{"date":"2026-08-17","pkg":"com.luizalabs.mlapp","ad_unit":"91530547_Magalu_BR","impressions":12,"clicks":2,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.16667,"ivr":0,"cvr":0},
{"date":"2026-08-17","pkg":"com.levelinfinite.sgameGlobal_in","ad_unit":"91530535_HonorofKings_IN","impressions":18,"clicks":8,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.44444,"ivr":0,"cvr":0},
{"date":"2026-08-17","pkg":"com.levelinfinite.sgameGlobal_ph","ad_unit":"91530534_HonorofKings_PH","impressions":2,"clicks":0,"conversions":0,"ecpm":0,"cpc":0,"ctr":0,"ivr":0,"cvr":0},
{"date":"2026-08-18","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":33211,"clicks":508,"conversions":20,"ecpm":0.301,"cpc":0.02,"ctr":0.0153,"ivr":0.0006,"cvr":0.03937},
{"date":"2026-08-18","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":163377,"clicks":43382,"conversions":19,"ecpm":0.052,"cpc":0,"ctr":0.26553,"ivr":0.00012,"cvr":0.00044},
{"date":"2026-08-18","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":21925,"clicks":1853,"conversions":2,"ecpm":0.059,"cpc":0.001,"ctr":0.08452,"ivr":0.00009,"cvr":0.00108},
{"date":"2026-08-18","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":9249,"clicks":247,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.02671,"ivr":0,"cvr":0},
{"date":"2026-08-19","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":40503,"clicks":629,"conversions":23,"ecpm":0.284,"cpc":0.018,"ctr":0.01553,"ivr":0.00057,"cvr":0.03657},
{"date":"2026-08-19","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":51738,"clicks":9944,"conversions":19,"ecpm":0.165,"cpc":0.001,"ctr":0.1922,"ivr":0.00037,"cvr":0.00191},
{"date":"2026-08-19","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":18978,"clicks":1251,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.06592,"ivr":0,"cvr":0},
{"date":"2026-08-19","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":8912,"clicks":228,"conversions":2,"ecpm":0.112,"cpc":0.004,"ctr":0.02558,"ivr":0.00022,"cvr":0.00877},
{"date":"2026-08-20","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":8620,"clicks":258,"conversions":1,"ecpm":0.058,"cpc":0.002,"ctr":0.02993,"ivr":0.00012,"cvr":0.00388},
{"date":"2026-08-20","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":21010,"clicks":2211,"conversions":1,"ecpm":0.031,"cpc":0,"ctr":0.10524,"ivr":0.00005,"cvr":0.00045},
{"date":"2026-08-20","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":54406,"clicks":7459,"conversions":19,"ecpm":0.157,"cpc":0.001,"ctr":0.1371,"ivr":0.00035,"cvr":0.00255},
{"date":"2026-08-20","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":42226,"clicks":669,"conversions":25,"ecpm":0.296,"cpc":0.019,"ctr":0.01584,"ivr":0.00059,"cvr":0.03737},
{"date":"2026-08-21","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":8048,"clicks":236,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.02932,"ivr":0,"cvr":0},
{"date":"2026-08-21","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":14550,"clicks":1383,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.09505,"ivr":0,"cvr":0},
{"date":"2026-08-21","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":105591,"clicks":22397,"conversions":19,"ecpm":0.104,"cpc":0,"ctr":0.21211,"ivr":0.00018,"cvr":0.00085},
{"date":"2026-08-21","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":39951,"clicks":852,"conversions":30,"ecpm":0.375,"cpc":0.018,"ctr":0.02133,"ivr":0.00075,"cvr":0.03521},
{"date":"2026-08-22","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":10089,"clicks":371,"conversions":2,"ecpm":0.099,"cpc":0.003,"ctr":0.03677,"ivr":0.0002,"cvr":0.00539},
{"date":"2026-08-22","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":13944,"clicks":1460,"conversions":0,"ecpm":0,"cpc":0,"ctr":0.1047,"ivr":0,"cvr":0},
{"date":"2026-08-22","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":104031,"clicks":30747,"conversions":19,"ecpm":0.11,"cpc":0,"ctr":0.29556,"ivr":0.00018,"cvr":0.00062},
{"date":"2026-08-22","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":33215,"clicks":767,"conversions":54,"ecpm":0.813,"cpc":0.035,"ctr":0.02309,"ivr":0.00163,"cvr":0.0704},
{"date":"2026-08-23","pkg":"com.sialiagames.xczyw.gp.tw","ad_unit":"91533906_xczyw_TW","impressions":9577,"clicks":405,"conversions":1,"ecpm":0.052,"cpc":0.001,"ctr":0.04229,"ivr":0.0001,"cvr":0.00247},
{"date":"2026-08-23","pkg":"com.qookkagames.xczyw.gp.hk","ad_unit":"91534913_xczyw_HK","impressions":13892,"clicks":1432,"conversions":1,"ecpm":0.047,"cpc":0,"ctr":0.10308,"ivr":0.00007,"cvr":0.0007},
{"date":"2026-08-23","pkg":"net.mbc.shahid","ad_unit":"91530537_MBCShahid_SA","impressions":44565,"clicks":11596,"conversions":19,"ecpm":0.256,"cpc":0.001,"ctr":0.2602,"ivr":0.00043,"cvr":0.00164},
{"date":"2026-08-23","pkg":"com.igg.android.lordsmobile","ad_unit":"91530536_IGG_RU","impressions":37835,"clicks":1698,"conversions":45,"ecpm":0.595,"cpc":0.013,"ctr":0.04488,"ivr":0.00119,"cvr":0.0265}
]
+321
View File
@@ -0,0 +1,321 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Moboos 广告投放报告</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #f5f7fa;
color: #333;
padding: 20px;
}
.header {
text-align: center;
padding: 30px 0 20px;
}
.header h1 {
font-size: 24px;
color: #1a1a2e;
margin-bottom: 8px;
}
.header p {
color: #666;
font-size: 14px;
}
.controls {
max-width: 1400px;
margin: 0 auto 20px;
display: flex;
gap: 12px;
flex-wrap: wrap;
align-items: center;
}
.controls label {
font-size: 13px;
color: #555;
font-weight: 500;
}
.controls select {
padding: 6px 12px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 13px;
background: #fff;
cursor: pointer;
}
.charts-grid {
max-width: 1400px;
margin: 0 auto 30px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
.chart-card {
background: #fff;
border-radius: 12px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.chart-card h3 {
font-size: 14px;
color: #555;
margin-bottom: 12px;
}
.chart-card canvas {
width: 100% !important;
height: 250px !important;
}
.table-section {
max-width: 1400px;
margin: 0 auto;
background: #fff;
border-radius: 12px;
padding: 20px;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
overflow-x: auto;
}
.table-section h2 {
font-size: 16px;
color: #1a1a2e;
margin-bottom: 15px;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}
th {
background: #f0f2f5;
padding: 10px 8px;
text-align: left;
font-weight: 600;
color: #555;
white-space: nowrap;
position: sticky;
top: 0;
}
td {
padding: 8px;
border-bottom: 1px solid #f0f2f5;
white-space: nowrap;
}
tr:hover td {
background: #f8f9fb;
}
.pkg-tag {
display: inline-block;
padding: 2px 6px;
border-radius: 4px;
font-size: 11px;
background: #e8f4fd;
color: #1976d2;
}
.metric-up { color: #4caf50; }
.metric-down { color: #f44336; }
@media (max-width: 900px) {
.charts-grid { grid-template-columns: 1fr; }
}
.updated-time {
text-align: center;
color: #999;
font-size: 12px;
margin-top: 20px;
padding-bottom: 20px;
}
</style>
</head>
<body>
<div class="header">
<h1>Moboos 广告投放数据报告</h1>
<p>数据范围:每日自动更新</p>
</div>
<div class="controls">
<label>筛选广告主:</label>
<select id="pkgFilter">
<option value="all">全部</option>
</select>
<label style="margin-left:12px;">指标:</label>
<select id="metricFilter">
<option value="impressions">展示</option>
<option value="clicks">点击</option>
<option value="conversions">转化</option>
<option value="ecpm">eCPM</option>
<option value="cpc">CPC</option>
<option value="ctr">CTR</option>
<option value="ivr">IVR</option>
<option value="cvr">CVR</option>
</select>
</div>
<div class="charts-grid">
<div class="chart-card">
<h3>展示量趋势</h3>
<canvas id="chartImpressions"></canvas>
</div>
<div class="chart-card">
<h3>点击量趋势</h3>
<canvas id="chartClicks"></canvas>
</div>
<div class="chart-card">
<h3>转化量趋势</h3>
<canvas id="chartConversions"></canvas>
</div>
<div class="chart-card">
<h3>eCPM 趋势</h3>
<canvas id="chartEcpm"></canvas>
</div>
</div>
<div class="table-section">
<h2>明细数据</h2>
<table id="dataTable">
<thead>
<tr>
<th>日期</th>
<th>广告单元</th>
<th>Pkg</th>
<th>展示</th>
<th>点击</th>
<th>转化</th>
<th>eCPM</th>
<th>CPC</th>
<th>CTR</th>
<th>IVR</th>
<th>CVR</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="updated-time" id="updatedTime"></div>
<script>
const COLORS = [
'#1976d2','#e53935','#43a047','#fb8c00','#8e24aa',
'#00acc1','#6d4c41','#546e7a','#d81b60','#00897b'
];
let rawData = [];
let charts = {};
async function loadData() {
try {
const resp = await fetch('data.json?' + Date.now());
rawData = await resp.json();
init();
} catch(e) {
console.error('Failed to load data:', e);
}
}
function init() {
populateFilter();
renderAll();
document.getElementById('pkgFilter').addEventListener('change', renderAll);
document.getElementById('metricFilter').addEventListener('change', renderAll);
document.getElementById('updatedTime').textContent = '数据更新时间:' + new Date().toLocaleString('zh-CN');
}
function populateFilter() {
const pkgs = [...new Set(rawData.map(d => d.pkg))];
const sel = document.getElementById('pkgFilter');
pkgs.forEach(p => {
const opt = document.createElement('option');
opt.value = p;
opt.textContent = p.split('.').pop();
sel.appendChild(opt);
});
}
function getFilteredData() {
const pkg = document.getElementById('pkgFilter').value;
if (pkg === 'all') return rawData;
return rawData.filter(d => d.pkg === pkg);
}
function renderAll() {
renderCharts();
renderTable();
}
function renderCharts() {
const data = getFilteredData();
const dates = [...new Set(data.map(d => d.date))].sort();
const pkgs = [...new Set(data.map(d => d.pkg))];
renderChart('chartImpressions', dates, pkgs, data, 'impressions');
renderChart('chartClicks', dates, pkgs, data, 'clicks');
renderChart('chartConversions', dates, pkgs, data, 'conversions');
renderChart('chartEcpm', dates, pkgs, data, 'ecpm');
}
function renderChart(canvasId, dates, pkgs, data, metric) {
if (charts[canvasId]) charts[canvasId].destroy();
const datasets = pkgs.map((pkg, i) => {
const values = dates.map(date => {
const rows = data.filter(d => d.date === date && d.pkg === pkg);
if (rows.length === 0) return null;
return rows.reduce((sum, r) => sum + (r[metric] || 0), 0);
});
return {
label: pkg.split('.').pop(),
data: values,
borderColor: COLORS[i % COLORS.length],
backgroundColor: COLORS[i % COLORS.length] + '20',
borderWidth: 2,
pointRadius: 3,
tension: 0.3,
fill: false
};
});
const ctx = document.getElementById(canvasId).getContext('2d');
charts[canvasId] = new Chart(ctx, {
type: 'line',
data: { labels: dates.map(d => d.slice(5)), datasets },
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { position: 'bottom', labels: { boxWidth: 12, font: { size: 11 } } }
},
scales: {
x: { grid: { display: false } },
y: { beginAtZero: true, grid: { color: '#f0f0f0' } }
}
}
});
}
function renderTable() {
const data = getFilteredData();
const sorted = [...data].sort((a, b) => b.date.localeCompare(a.date) || a.pkg.localeCompare(b.pkg));
const tbody = document.querySelector('#dataTable tbody');
tbody.innerHTML = sorted.map(d => `
<tr>
<td>${d.date}</td>
<td>${d.ad_unit}</td>
<td><span class="pkg-tag">${d.pkg}</span></td>
<td>${d.impressions.toLocaleString()}</td>
<td>${d.clicks.toLocaleString()}</td>
<td>${d.conversions}</td>
<td>${d.ecpm.toFixed(3)}</td>
<td>${d.cpc.toFixed(3)}</td>
<td>${(d.ctr * 100).toFixed(2)}%</td>
<td>${(d.ivr * 100).toFixed(3)}%</td>
<td>${(d.cvr * 100).toFixed(2)}%</td>
</tr>
`).join('');
}
loadData();
</script>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
24
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
# update.sh - 从上传的 Excel 数据同步到 data.json
# 服务器每天自动执行一次(由 schedule.conf 控制)
# 数据来源:手动上传的 data.json(通过 git push 更新)
# 如果后续有 API 数据源,可以在这里用 curl 拉取并写入 data.json
echo "$(date '+%Y-%m-%d %H:%M:%S') - data.json is up to date (manual upload mode)"