Spaces:
Running
Can you also add data this to a new block: Location,What Improved,What Was Constrained,What's Next
Browse filesChadwell,"CPC down ~48 percent, higher engagement","Call tracking not enabled","Enable call tracking and scale service campaigns"
Ellicott City ER,"Efficiency improved, calls rebounded","Temporary pharmacy policy pause","Restore budget and add call-only emergency ads"
Bay Beach,"Higher call and direction volume, CPC down","Impression share capped","Scale budget and launch remarketing"
Beltsville,"Improved traffic quality","Funnel optimization needed","Landing page and tracking improvements"
Dr Dan's,"CPC significantly reduced","Tracking limitations","Fix tracking and relaunch campaigns"
Hoffman,"Higher engagement time","Low booking actions","Shift budget to booking-intent ads"
Mixed Pet,"Lower CPC and deeper sessions","Weak calls to action","Deploy booking-first landing pages"
Colonial,"Stable performance","UX and engagement issues","UX audit and simplified booking path"
Jackson Square,"Stable engagement","Limited scale and tracking","Improve tracking and cautiously scale"
Files changed (6)
- README.md+7-4
- components/header.jsAdded+60
- components/metric-card.jsAdded+60
- index.html+61-19
- script.jsAdded+179
- style.css+24-18
1234234567891011101213---title: Metric Marvels Dashboardemoji: 📈colorFrom: bluetitle: Metric Marvels Dashboard 🚀colorFrom: graycolorTo: purpleemoji: 🐳sdk: staticpinned: falsetags: - deepsite-v3---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference# Welcome to your new DeepSite project!This project was created with [DeepSite](https://huggingface.co/deepsite).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960class CustomHeader extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .header { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); color: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); } .logo { font-weight: 700; letter-spacing: -0.025em; } .nav-link { transition: all 0.2s ease; } .nav-link:hover { opacity: 0.8; } </style> <header class="header"> <div class="container mx-auto px-4 py-4"> <div class="flex items-center justify-between"> <div class="flex items-center space-x-4"> <div class="logo text-xl font-bold">AdMetrics</div> <nav class="hidden md:flex space-x-6"> <a href="#" class="nav-link flex items-center space-x-1"> <i data-feather="home" class="w-4 h-4"></i> <span>Dashboard</span> </a> <a href="#" class="nav-link flex items-center space-x-1"> <i data-feather="bar-chart-2" class="w-4 h-4"></i> <span>Analytics</span> </a> <a href="#" class="nav-link flex items-center space-x-1"> <i data-feather="settings" class="w-4 h-4"></i> <span>Settings</span> </a> </nav> </div> <div class="flex items-center space-x-4"> <button class="p-2 rounded-full hover:bg-white hover:bg-opacity-10 transition"> <i data-feather="bell"></i> </button> <div class="flex items-center space-x-2"> <div class="w-8 h-8 rounded-full bg-white bg-opacity-20 flex items-center justify-center"> <i data-feather="user"></i> </div> <span class="hidden md:inline">Admin</span> </div> </div> </div> </div> </header> `; }}
customElements.define('custom-header', CustomHeader);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960class MetricCard extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> .card { background: white; border-radius: 0.75rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); transition: transform 0.2s ease, box-shadow 0.2s ease; } .card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); } .icon-container { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; } .progress-bar { height: 0.5rem; border-radius: 0.25rem; background-color: #E5E7EB; } .progress-fill { height: 100%; border-radius: 0.25rem; } </style> <div class="card p-6"> <div class="flex justify-between items-start mb-4"> <div> <h3 class="text-sm font-medium text-gray-500"><slot name="title">Metric</slot></h3> <p class="mt-1 text-2xl font-semibold text-gray-900"><slot name="value">0</slot></p> </div> <div class="icon-container" style="background-color: var(--icon-bg, #EFF6FF); color: var(--icon-color, #3B82F6);"> <slot name="icon"> <i data-feather="activity"></i> </slot> </div> </div> <div class="mt-6"> <div class="flex items-center justify-between mb-2"> <span class="text-sm font-medium text-gray-500"><slot name="progress-label">Progress</slot></span> <span class="text-sm font-semibold" style="color: var(--progress-color, #10B981);"><slot name="progress-value">0%</slot></span> </div> <div class="progress-bar"> <div class="progress-fill" style="width: var(--progress-width, 0%); background-color: var(--progress-color, #10B981);"></div> </div> </div> </div> `; }}
customElements.define('metric-card', MetricCard);1234567891011121314151617181912345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>My static Space</title> <link rel="stylesheet" href="style.css" /> </head> <body> <div class="card"> <h1>Welcome to your static Space!</h1> <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p> <p> Also don't forget to check the <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>. </p> </div> </body></html><!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>AdMetrics Dashboard</title> <link rel="stylesheet" href="style.css"> <script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> <script src="https://unpkg.com/feather-icons"></script> <script src="components/metric-card.js"></script> <script src="components/header.js"></script></head><body class="bg-gray-50 min-h-screen"> <custom-header></custom-header> <main class="container mx-auto px-4 py-8"> <div class="flex justify-between items-center mb-8"> <h1 class="text-3xl font-bold text-gray-800">Performance Metrics</h1> <div class="flex space-x-2"> <button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition"> <i data-feather="download" class="inline mr-2"></i> Export </button> <button class="px-4 py-2 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition"> <i data-feather="filter" class="inline mr-2"></i> Filter </button> </div> </div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> <!-- Metric cards will be inserted here by JavaScript --> </div>
<div class="mt-12 bg-white rounded-xl shadow-md overflow-hidden"> <div class="px-6 py-4 border-b border-gray-200"> <h2 class="text-xl font-semibold text-gray-800">Detailed Performance Data</h2> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Metric</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">October Baseline</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Current (Nov-Dec)</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Trend</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="data-table"> <!-- Table data will be inserted here by JavaScript --> </tbody> </table> </div> </div> </main>
<script src="script.js"></script> <script>feather.replace();</script><script src="https://huggingface.co/deepsite/deepsite-badge.js"></script></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179document.addEventListener('DOMContentLoaded', function() { const data = [ { location: 'Chadwell', metric: 'Avg CPC', baseline: '3.47', current: '1.80', trend: 'Improved' }, { location: 'Chadwell', metric: 'Cost per Conversion', baseline: '3.42', current: 'Lower or Stable', trend: 'Improved' }, { location: 'Ellicott City ER', metric: 'Avg CPC', baseline: '1.77', current: '1.80', trend: 'Stable' }, { location: 'Ellicott City ER', metric: 'Cost per Conversion', baseline: '5.81', current: 'Lower', trend: 'Improved' }, { location: 'Bay Beach', metric: 'Avg CPC', baseline: '3.19', current: '2.79', trend: 'Improved' }, { location: 'Bay Beach', metric: 'Cost per Conversion', baseline: '7.42', current: 'Lower', trend: 'Improved' }, { location: 'Beltsville', metric: 'Avg CPC', baseline: '1.96', current: '2.00', trend: 'Stable' }, { location: "Dr Dan's", metric: 'Avg CPC', baseline: '19.92', current: 'Much Lower', trend: 'Improved' }, { location: 'Hoffman', metric: 'Avg CPC', baseline: '3.60', current: '3.50', trend: 'Stable' }, { location: 'Mixed Pet', metric: 'Avg CPC', baseline: '10.43', current: 'Lower', trend: 'Improved' }, { location: 'Colonial', metric: 'Avg CPC', baseline: '9.15', current: 'Slightly Lower', trend: 'Improved' }, { location: 'Jackson Square', metric: 'Avg CPC', baseline: '6.21', current: 'Lower', trend: 'Improved' } ];
// Populate table const tableBody = document.getElementById('data-table'); data.forEach(item => { const row = document.createElement('tr'); row.className = 'hover:bg-gray-50'; const trendClass = item.trend === 'Improved' ? 'trend-improved' : item.trend === 'Stable' ? 'trend-stable' : 'trend-worsened'; row.innerHTML = ` <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${item.location}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.metric}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.baseline}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.current}</td> <td class="px-6 py-4 whitespace-nowrap text-sm ${trendClass} font-semibold"> <i data-feather="${item.trend === 'Improved' ? 'trending-up' : item.trend === 'Stable' ? 'minus' : 'trending-down'}" class="inline mr-1"></i> ${item.trend} </td> `; tableBody.appendChild(row); });
// Create summary cards const cardsContainer = document.querySelector('.grid'); // Avg CPC Summary const avgCPCData = data.filter(item => item.metric === 'Avg CPC'); const improvedCPC = avgCPCData.filter(item => item.trend === 'Improved').length; const cpcCard = document.createElement('div'); cpcCard.className = 'bg-white rounded-xl shadow-card p-6'; cpcCard.innerHTML = ` <div class="flex justify-between items-start"> <div> <p class="text-sm font-medium text-gray-500">Avg CPC</p> <h3 class="mt-1 text-2xl font-semibold text-gray-900">${avgCPCData.length} Locations</h3> </div> <div class="p-3 rounded-lg bg-blue-100 text-blue-600"> <i data-feather="dollar-sign"></i> </div> </div> <div class="mt-6"> <div class="flex items-center justify-between mb-2"> <span class="text-sm font-medium text-gray-500">Improved</span> <span class="text-sm font-semibold text-green-600">${improvedCPC} (${Math.round((improvedCPC/avgCPCData.length)*100)}%)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: ${(improvedCPC/avgCPCData.length)*100}%"></div> </div> </div> `; cardsContainer.appendChild(cpcCard);
// Cost per Conversion Summary const convData = data.filter(item => item.metric === 'Cost per Conversion'); const improvedConv = convData.filter(item => item.trend === 'Improved').length; const convCard = document.createElement('div'); convCard.className = 'bg-white rounded-xl shadow-card p-6'; convCard.innerHTML = ` <div class="flex justify-between items-start"> <div> <p class="text-sm font-medium text-gray-500">Cost per Conversion</p> <h3 class="mt-1 text-2xl font-semibold text-gray-900">${convData.length} Locations</h3> </div> <div class="p-3 rounded-lg bg-purple-100 text-purple-600"> <i data-feather="activity"></i> </div> </div> <div class="mt-6"> <div class="flex items-center justify-between mb-2"> <span class="text-sm font-medium text-gray-500">Improved</span> <span class="text-sm font-semibold text-green-600">${improvedConv} (${Math.round((improvedConv/convData.length)*100)}%)</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: ${(improvedConv/convData.length)*100}%"></div> </div> </div> `; cardsContainer.appendChild(convCard);
// Overall Performance const overallCard = document.createElement('div'); overallCard.className = 'bg-white rounded-xl shadow-card p-6'; overallCard.innerHTML = ` <div class="flex justify-between items-start"> <div> <p class="text-sm font-medium text-gray-500">Overall Performance</p> <h3 class="mt-1 text-2xl font-semibold text-gray-900">${data.length} Metrics</h3> </div> <div class="p-3 rounded-lg bg-green-100 text-green-600"> <i data-feather="bar-chart-2"></i> </div> </div> <div class="mt-6 space-y-4"> <div> <div class="flex items-center justify-between mb-1"> <span class="text-sm font-medium text-gray-500">Improved</span> <span class="text-sm font-semibold text-green-600">${data.filter(item => item.trend === 'Improved').length}</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-green-500 h-2 rounded-full" style="width: ${(data.filter(item => item.trend === 'Improved').length/data.length)*100}%"></div> </div> </div> <div> <div class="flex items-center justify-between mb-1"> <span class="text-sm font-medium text-gray-500">Stable</span> <span class="text-sm font-semibold text-yellow-500">${data.filter(item => item.trend === 'Stable').length}</span> </div> <div class="w-full bg-gray-200 rounded-full h-2"> <div class="bg-yellow-400 h-2 rounded-full" style="width: ${(data.filter(item => item.trend === 'Stable').length/data.length)*100}%"></div> </div> </div> </div> `; cardsContainer.appendChild(overallCard); // Add strategic insights section const insightsData = [ { location: 'Chadwell', improved: 'CPC down ~48 percent, higher engagement', constrained: 'Call tracking not enabled', next: 'Enable call tracking and scale service campaigns' }, { location: 'Ellicott City ER', improved: 'Efficiency improved, calls rebounded', constrained: 'Temporary pharmacy policy pause', next: 'Restore budget and add call-only emergency ads' }, { location: 'Bay Beach', improved: 'Higher call and direction volume, CPC down', constrained: 'Impression share capped', next: 'Scale budget and launch remarketing' }, { location: 'Beltsville', improved: 'Improved traffic quality', constrained: 'Funnel optimization needed', next: 'Landing page and tracking improvements' }, { location: "Dr Dan's", improved: 'CPC significantly reduced', constrained: 'Tracking limitations', next: 'Fix tracking and relaunch campaigns' }, { location: 'Hoffman', improved: 'Higher engagement time', constrained: 'Low booking actions', next: 'Shift budget to booking-intent ads' }, { location: 'Mixed Pet', improved: 'Lower CPC and deeper sessions', constrained: 'Weak calls to action', next: 'Deploy booking-first landing pages' }, { location: 'Colonial', improved: 'Stable performance', constrained: 'UX and engagement issues', next: 'UX audit and simplified booking path' }, { location: 'Jackson Square', improved: 'Stable engagement', constrained: 'Limited scale and tracking', next: 'Improve tracking and cautiously scale' } ];
const insightsContainer = document.createElement('div'); insightsContainer.className = 'mt-12 bg-white rounded-xl shadow-md overflow-hidden'; insightsContainer.innerHTML = ` <div class="px-6 py-4 border-b border-gray-200"> <h2 class="text-xl font-semibold text-gray-800">Strategic Insights</h2> </div> <div class="overflow-x-auto"> <table class="min-w-full divide-y divide-gray-200"> <thead class="bg-gray-50"> <tr> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">What Improved</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">What Was Constrained</th> <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">What's Next</th> </tr> </thead> <tbody class="bg-white divide-y divide-gray-200" id="insights-table"> ${insightsData.map(item => ` <tr class="hover:bg-gray-50"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${item.location}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.improved}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.constrained}</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${item.next}</td> </tr> `).join('')} </tbody> </table> </div> `; document.querySelector('main').appendChild(insightsContainer);
// Refresh feather icons after dynamic content is added feather.replace();});123234567891067811121314111213141515161718181920212223192021222627232425262728293031323334@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body { padding: 2rem; font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif; font-family: 'Inter', sans-serif;}
.trend-improved { color: #10B981;}
h1 { font-size: 16px; margin-top: 0;.trend-stable { color: #F59E0B;}
p { color: rgb(107, 114, 128); font-size: 15px; margin-bottom: 10px; margin-top: 5px;.trend-worsened { color: #EF4444;}
.card { max-width: 620px; margin: 0 auto; padding: 16px; border: 1px solid lightgray; border-radius: 16px;.shadow-card { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);}
.card p:last-child { margin-bottom: 0;.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; }}