Cpm Impression Calculator

CPM Impression Calculator: Calculate Cost Per Mille Easily :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; padding-top: 20px; padding-bottom: 40px; } .container { width: 95%; max-width: 960px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); margin-bottom: 30px; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; margin-top: 30px; } h3 { font-size: 1.4em; margin-top: 25px; } .loan-calc-container { background-color: #f0f2f5; padding: 25px; border-radius: 6px; margin-bottom: 30px; border: 1px solid var(–border-color); } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px 12px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .input-group .error-message { color: #dc3545; font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex: 1; } .button-group button.calculate-btn { background-color: var(–primary-color); color: white; } .button-group button.calculate-btn:hover { background-color: #003366; } .button-group button.reset-btn { background-color: #6c757d; color: white; } .button-group button.reset-btn:hover { background-color: #5a6268; } .button-group button.copy-btn { background-color: var(–success-color); color: white; } .button-group button.copy-btn:hover { background-color: #218838; } #results { margin-top: 30px; padding: 25px; background-color: #e9ecef; border-radius: 6px; border: 1px solid var(–border-color); } #results h3 { margin-top: 0; color: var(–primary-color); } .result-item { margin-bottom: 15px; font-size: 1.1em; } .result-item strong { color: var(–primary-color); display: inline-block; min-width: 200px; } .primary-result { background-color: var(–primary-color); color: white; padding: 15px 20px; border-radius: 5px; text-align: center; font-size: 1.8em; font-weight: bold; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0, 74, 153, 0.3); } .primary-result span { font-size: 0.8em; font-weight: normal; display: block; margin-top: 5px; } .formula-explanation { font-size: 0.95em; color: #555; margin-top: 15px; padding-top: 15px; border-top: 1px dashed var(–border-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f8f9fa; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; border: 1px solid var(–border-color); border-radius: 4px; } .article-content { width: 95%; max-width: 960px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); text-align: left; } .article-content p, .article-content ul, .article-content ol { margin-bottom: 20px; font-size: 1.05em; } .article-content ul, .article-content ol { padding-left: 30px; } .article-content li { margin-bottom: 10px; } .article-content a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .article-content a:hover { text-decoration: underline; } .faq-item { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px dashed var(–border-color); } .faq-item:last-child { border-bottom: none; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; font-size: 1.15em; } .related-tools ul { list-style: none; padding: 0; } .related-tools li { margin-bottom: 15px; padding: 10px; background-color: #f0f2f5; border-radius: 4px; border-left: 4px solid var(–primary-color); } .related-tools li a { font-weight: bold; display: block; margin-bottom: 5px; } .related-tools li p { margin-bottom: 0; font-size: 0.95em; color: #555; } .highlight { background-color: var(–success-color); color: white; padding: 2px 5px; border-radius: 3px; font-weight: bold; } .variable-table th, .variable-table td { font-size: 0.95em; } .variable-table th { background-color: #e0e7f0; color: var(–primary-color); } .variable-table td { background-color: #f8f9fa; } .variable-table tr:nth-child(even) td { background-color: #ffffff; }

CPM Impression Calculator

Calculate your Cost Per Mille (Thousand Impressions) for digital advertising campaigns.

Calculate Your CPM

Enter the total amount spent on the advertising campaign.
Enter the total number of times your ad was displayed.

Calculation Results

–.– CPM (Cost Per Mille)
Total Ad Spend: –.–
Total Impressions: –,–
Cost Per Impression: –.–
Formula Used: CPM = (Total Ad Spend / Total Impressions) * 1000

CPM Trend Analysis

Visualizing CPM based on varying ad spend and impressions.

Campaign Performance Metrics

Key Metrics Overview
Metric Value Description
Total Ad Spend –.– Total investment in the ad campaign.
Total Impressions –,– Number of times the ad was shown.
Cost Per Impression (CPI) –.– Cost for each single ad impression.
Cost Per Mille (CPM) –.– Cost for every 1,000 ad impressions.

What is CPM Impression Calculator?

A CPM Impression Calculator is a specialized online tool designed to help advertisers, marketers, and businesses quickly determine the Cost Per Mille (CPM) of their digital advertising campaigns. CPM, which stands for Cost Per Mille (Latin for thousand), represents the cost an advertiser pays for one thousand views or impressions of an advertisement. This calculator simplifies the process by taking your total ad spend and the total number of impressions generated by that spend, then outputting the CPM value. Understanding CPM is crucial for evaluating the efficiency and cost-effectiveness of various advertising platforms and campaign strategies. It allows for direct comparison of ad costs across different channels, even if they have vastly different pricing models.

Who Should Use a CPM Impression Calculator?

Several professionals and entities benefit from using a cpm impression calculator:

  • Digital Marketers & Advertisers: To budget effectively, compare ad network performance, and negotiate rates.
  • Media Buyers: To assess the value of ad inventory and make informed purchasing decisions.
  • Small Business Owners: To understand the cost of reaching their target audience online without needing deep analytical expertise.
  • Content Creators & Publishers: To set advertising rates for their own platforms and understand the value they offer to advertisers.
  • Marketing Agencies: To report campaign performance to clients and optimize ad spend across multiple channels.

Common Misconceptions about CPM

Several common misunderstandings surround CPM:

  • CPM is the only metric that matters: While important for cost efficiency, CPM doesn't guarantee engagement or conversions. A low CPM with poor results is less valuable than a slightly higher CPM that drives significant business outcomes.
  • All CPMs are equal: The value of an impression can vary wildly based on targeting, ad placement, audience quality, and the platform itself. A high-quality impression in a relevant context is worth more than a low-quality one.
  • CPM is a fixed rate: CPMs fluctuate based on demand, seasonality, audience targeting, ad format, and competition. Real-time bidding (RTB) environments mean CPMs can change constantly.

CPM Impression Calculator Formula and Mathematical Explanation

The core of the cpm impression calculator lies in a straightforward mathematical formula. It quantifies the cost associated with reaching a thousand potential viewers.

The CPM Formula

The formula to calculate CPM is:

CPM = (Total Ad Spend / Total Impressions) * 1000

Variable Explanations

Let's break down the components:

  • Total Ad Spend: This is the total amount of money you have invested in a specific advertising campaign or placement. It includes all costs associated with running the ads.
  • Total Impressions: This refers to the total number of times your advertisement was displayed to users. Each instance of an ad being shown counts as one impression.
  • 1000: This multiplier is used because CPM stands for "Cost Per Mille," and "Mille" is Latin for thousand. We are calculating the cost for every thousand impressions.

Variables Table

CPM Calculation Variables
Variable Meaning Unit Typical Range
Total Ad Spend Total expenditure on advertising. Currency (e.g., USD, EUR) $10 – $1,000,000+
Total Impressions Number of times an ad is displayed. Count 100 – 10,000,000+
CPM Cost per 1,000 impressions. Currency per 1,000 impressions (e.g., $/1000 impressions) $0.50 – $50+ (highly variable)
Cost Per Impression (CPI) Cost for a single impression. Currency (e.g., USD, EUR) $0.0005 – $0.05+

Mathematical Derivation

First, we calculate the cost for a single impression by dividing the total ad spend by the total number of impressions: Cost Per Impression (CPI) = Total Ad Spend / Total Impressions. Since CPM is the cost for *one thousand* impressions, we multiply this CPI by 1000: CPM = CPI * 1000. Substituting the CPI formula, we arrive at the standard CPM formula: CPM = (Total Ad Spend / Total Impressions) * 1000.

Practical Examples (Real-World Use Cases)

Let's illustrate how the cpm impression calculator works with practical scenarios:

Example 1: Social Media Ad Campaign

A small e-commerce business runs a Facebook ad campaign to promote a new product. They spend $500 and achieve 150,000 impressions.

  • Inputs:
    • Total Ad Spend: $500
    • Total Impressions: 150,000
  • Calculation:
    • Cost Per Impression = $500 / 150,000 = $0.00333
    • CPM = $0.00333 * 1000 = $3.33
  • Result: The CPM is $3.33.
  • Interpretation: This means the business paid approximately $3.33 for every 1,000 times their ad was displayed on Facebook. This is a relatively low CPM, suggesting good cost efficiency for reach on this platform for this campaign.

Example 2: Display Advertising Network

A SaaS company uses a programmatic display advertising network to generate leads. They invest $2,000 in a campaign that delivers 500,000 impressions across various websites.

  • Inputs:
    • Total Ad Spend: $2,000
    • Total Impressions: 500,000
  • Calculation:
    • Cost Per Impression = $2,000 / 500,000 = $0.004
    • CPM = $0.004 * 1000 = $4.00
  • Result: The CPM is $4.00.
  • Interpretation: The company paid $4.00 for every 1,000 impressions. This CPM might be considered average or slightly high depending on the industry and targeting precision. They would compare this to other channels to ensure it aligns with their overall marketing budget allocation.

How to Use This CPM Impression Calculator

Using our cpm impression calculator is designed to be simple and intuitive. Follow these steps:

  1. Enter Total Ad Spend: Input the exact amount of money you spent on your advertising campaign into the "Total Ad Spend" field. Ensure you use the correct currency.
  2. Enter Total Impressions: Input the total number of times your ads were displayed during that campaign into the "Total Impressions" field.
  3. Click Calculate: Press the "Calculate CPM" button.

How to Read Results

The calculator will immediately display:

  • Primary Result (CPM): This is the main output, shown prominently. It tells you the cost for every 1,000 impressions. A lower CPM generally indicates better cost-efficiency for reaching a large audience.
  • Intermediate Values: You'll also see the Total Ad Spend, Total Impressions, and the calculated Cost Per Impression (CPI).
  • Formula Explanation: A clear breakdown of the calculation used.
  • Chart and Table: Visual and tabular representations of the data, offering further insights.

Decision-Making Guidance

Use the CPM value to:

  • Compare Platforms: Evaluate which advertising channels offer the most cost-effective reach.
  • Negotiate Rates: Understand industry benchmarks to negotiate better deals with publishers or ad networks.
  • Optimize Campaigns: Identify campaigns with unusually high or low CPMs and investigate why. A high CPM might indicate inefficient targeting or high competition, while a very low CPM could suggest low-quality inventory or audience.
  • Budgeting: Estimate the cost of future campaigns based on desired reach. For example, if you need 5 million impressions and your CPM is $5, you'll need ($5 / 1000) * 5,000,000 = $25,000.

Key Factors That Affect CPM Results

Several elements influence the CPM you'll pay or achieve. Understanding these helps in optimizing campaigns and interpreting results from a cpm impression calculator:

  1. Audience Targeting Precision: Highly specific or niche audiences are often more expensive to reach, leading to higher CPMs, because the available inventory is smaller and more competitive. Broad targeting might yield lower CPMs but less relevant impressions.
  2. Ad Placement and Format: Premium ad placements (e.g., above the fold, within high-traffic content) or engaging formats (like video ads) typically command higher CPMs than less prominent or standard banner ads.
  3. Platform and Publisher Quality: Different advertising platforms (Google Ads, Facebook, LinkedIn) and individual websites or apps have varying CPMs based on their user base, reputation, and demand. High-authority sites often charge more.
  4. Time of Year (Seasonality): CPMs often increase during peak advertising seasons like the holiday season (Q4) due to increased advertiser demand. Conversely, they might decrease during off-peak periods.
  5. Ad Competition and Demand: High demand from advertisers competing for the same audience or ad space will drive up CPMs. Real-time bidding auctions are a prime example of this dynamic.
  6. Ad Quality and Relevance: While not directly part of the CPM calculation, ads that are poorly designed or irrelevant may lead to lower engagement, prompting advertisers to seek more effective (potentially higher CPM) placements. Conversely, highly engaging ads might justify a higher CPM.
  7. Geographic Location: CPMs can vary significantly by country or region. Advertisers targeting economically developed regions with higher consumer spending power often face higher CPMs.
  8. Device Type: Impressions served on desktops might have different CPMs compared to mobile devices, depending on user behavior and advertiser preferences.

Frequently Asked Questions (FAQ)

Q1: What is a "good" CPM?

A: A "good" CPM is relative and depends heavily on your industry, target audience, platform, and campaign goals. Generally, a lower CPM means you're reaching more people for less money. However, always balance CPM with engagement and conversion rates. Benchmarks vary widely, from under $1 for some display networks to over $50 for highly targeted or premium placements.

Q2: How does CPM differ from CPC?

A: CPM (Cost Per Mille) is the cost for 1,000 ad impressions (views), regardless of whether the user clicks. CPC (Cost Per Click) is the cost each time a user clicks on your ad. They measure different aspects of campaign cost-effectiveness: CPM for reach, CPC for traffic generation.

Q3: Can CPM be negative?

A: No, CPM cannot be negative. Ad spend is always a positive cost, and impressions are a positive count. Therefore, the resulting CPM will always be zero or positive.

Q4: What if my total impressions are zero?

A: If total impressions are zero, the CPM is undefined (division by zero). This indicates an issue with your campaign tracking or setup, as no ads were displayed despite potential spending. The calculator will show an error or infinity.

Q5: Does CPM guarantee engagement?

A: No. CPM only measures the cost of visibility. It does not guarantee that users will see, notice, or interact with your ad. Metrics like Click-Through Rate (CTR) and Conversion Rate are needed to assess engagement and effectiveness.

Q6: How can I lower my CPM?

A: You can try refining your audience targeting to less competitive segments, improving your ad creative to increase relevance and reduce perceived competition, exploring different ad placements or platforms, or advertising during off-peak seasons. Optimizing your ad campaign performance is key.

Q7: Is a high CPM always bad?

A: Not necessarily. A high CPM can be justified if it delivers highly qualified impressions to a valuable target audience on a reputable platform, leading to a strong return on investment (ROI) through conversions or sales. It's about the value of the impression, not just its cost.

Q8: How often should I check my CPM?

A: For active campaigns, monitoring CPM regularly (daily or weekly) is advisable, especially if using real-time bidding platforms. This allows for timely adjustments to optimize spending and performance.

var adSpendInput = document.getElementById('adSpend'); var impressionsInput = document.getElementById('impressions'); var adSpendError = document.getElementById('adSpendError'); var impressionsError = document.getElementById('impressionsError'); var primaryResult = document.getElementById('primaryResult'); var resultAdSpend = document.getElementById('resultAdSpend'); var resultImpressions = document.getElementById('resultImpressions'); var resultCPI = document.getElementById('resultCPI'); var tableAdSpend = document.getElementById('tableAdSpend'); var tableImpressions = document.getElementById('tableImpressions'); var tableCPI = document.getElementById('tableCPI'); var tableCPM = document.getElementById('tableCPM'); var cpmChart; var chartContext; function formatCurrency(value) { if (isNaN(value) || value === null) return '–.–'; return '$' + value.toFixed(2); } function formatNumber(value) { if (isNaN(value) || value === null) return '–,–'; return value.toLocaleString(); } function formatCPM(value) { if (isNaN(value) || value === null) return '–.–'; return '$' + value.toFixed(2); } function validateInput(inputElement, errorElement, minValue = 0) { var value = parseFloat(inputElement.value); var isValid = true; if (inputElement.value === ") { errorElement.textContent = 'This field cannot be empty.'; errorElement.style.display = 'block'; isValid = false; } else if (isNaN(value)) { errorElement.textContent = 'Please enter a valid number.'; errorElement.style.display = 'block'; isValid = false; } else if (value < minValue) { errorElement.textContent = 'Value cannot be negative.'; errorElement.style.display = 'block'; isValid = false; } else { errorElement.textContent = ''; errorElement.style.display = 'none'; } return isValid; } function calculateCPM() { var adSpendValid = validateInput(adSpendInput, adSpendError); var impressionsValid = validateInput(impressionsInput, impressionsError, 1); // Impressions must be at least 1 if (!adSpendValid || !impressionsValid) { primaryResult.textContent = '–.–'; resultAdSpend.textContent = '–.–'; resultImpressions.textContent = '–,–'; resultCPI.textContent = '–.–'; tableAdSpend.textContent = '–.–'; tableImpressions.textContent = '–,–'; tableCPI.textContent = '–.–'; tableCPM.textContent = '–.–'; return; } var adSpend = parseFloat(adSpendInput.value); var impressions = parseFloat(impressionsInput.value); var costPerImpression = adSpend / impressions; var cpm = costPerImpression * 1000; primaryResult.textContent = formatCPM(cpm); resultAdSpend.textContent = formatCurrency(adSpend); resultImpressions.textContent = formatNumber(impressions); resultCPI.textContent = formatCurrency(costPerImpression); tableAdSpend.textContent = formatCurrency(adSpend); tableImpressions.textContent = formatNumber(impressions); tableCPI.textContent = formatCurrency(costPerImpression); tableCPM.textContent = formatCPM(cpm); updateChart(adSpend, impressions, cpm); } function resetCalculator() { adSpendInput.value = '1000'; impressionsInput.value = '100000'; adSpendError.style.display = 'none'; impressionsError.style.display = 'none'; calculateCPM(); // Recalculate with default values } function copyResults() { var adSpend = parseFloat(adSpendInput.value); var impressions = parseFloat(impressionsInput.value); var cpmValue = parseFloat(primaryResult.textContent.replace(/[^0-9.-]+/g,"")); var cpiValue = parseFloat(resultCPI.textContent.replace(/[^0-9.-]+/g,"")); var textToCopy = "CPM Calculation Results:\n\n"; textToCopy += "Primary Result (CPM): " + formatCPM(cpmValue) + "\n"; textToCopy += "Total Ad Spend: " + formatCurrency(adSpend) + "\n"; textToCopy += "Total Impressions: " + formatNumber(impressions) + "\n"; textToCopy += "Cost Per Impression (CPI): " + formatCurrency(cpiValue) + "\n\n"; textToCopy += "Key Assumptions:\n"; textToCopy += "- Formula Used: CPM = (Total Ad Spend / Total Impressions) * 1000\n"; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Failed to copy results.'; alert(msg); // Simple feedback } catch (err) { alert('Oops, unable to copy'); } document.body.removeChild(textArea); } function initializeChart() { chartContext = document.getElementById('cpmChart').getContext('2d'); cpmChart = new Chart(chartContext, { type: 'bar', // Changed to bar for better comparison data: { labels: ['Campaign Metrics'], datasets: [{ label: 'Cost Per Impression (CPI)', data: [0], backgroundColor: 'rgba(0, 74, 153, 0.6)', borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1 }, { label: 'Cost Per Mille (CPM)', data: [0], backgroundColor: 'rgba(40, 167, 69, 0.6)', borderColor: 'rgba(40, 167, 69, 1)', borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { return '$' + value.toFixed(4); // Format y-axis as currency } } } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Cost Per Impression vs. Cost Per Mille' } } } }); } function updateChart(adSpend, impressions, cpm) { if (!cpmChart) { initializeChart(); } var costPerImpression = adSpend / impressions; cpmChart.data.datasets[0].data = [costPerImpression]; // CPI cpmChart.data.datasets[1].data = [cpm]; // CPM // Adjust labels if needed, though for single calculation, 'Campaign Metrics' is fine cpmChart.data.labels = ['Current Calculation']; cpmChart.update(); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { calculateCPM(); // Ensure chart is initialized if DOM is ready if (!chartContext) { initializeChart(); updateChart(parseFloat(adSpendInput.value), parseFloat(impressionsInput.value), parseFloat(primaryResult.textContent.replace(/[^0-9.-]+/g,""))); } }); // Add event listeners for real-time updates on input change adSpendInput.addEventListener('input', calculateCPM); impressionsInput.addEventListener('input', calculateCPM); // Basic Chart.js integration (assuming Chart.js library is available globally) // If Chart.js is not loaded, this part will fail. For a self-contained solution, // you'd need to include Chart.js library or use SVG/Canvas directly. // For this example, we assume Chart.js is available. // If not, replace with native canvas drawing or SVG. // — Native Canvas Drawing Alternative (if Chart.js is not allowed) — // This is a simplified example. A full implementation would require more logic. /* function drawCanvasChart(cpi, cpm) { var canvas = document.getElementById('cpmChart'); var ctx = canvas.getContext('2d'); canvas.width = canvas.offsetWidth; // Adjust canvas size canvas.height = 300; // Fixed height for example ctx.clearRect(0, 0, canvas.width, canvas.height); var barWidth = (canvas.width / 4); // Width for two bars + spacing var padding = 20; var chartHeight = canvas.height – 2 * padding; var maxValue = Math.max(cpi, cpm) * 1.2; // Add some buffer if (maxValue === 0) maxValue = 1; // Avoid division by zero // Draw Y-axis ctx.beginPath(); ctx.moveTo(padding, padding); ctx.lineTo(padding, canvas.height – padding); ctx.stroke(); ctx.fillText('$0.00', padding – 40, canvas.height – padding + 5); // Draw CPI Bar var cpiBarHeight = (cpi / maxValue) * chartHeight; ctx.fillStyle = 'rgba(0, 74, 153, 0.6)'; ctx.fillRect(padding + barWidth * 0.5, canvas.height – padding – cpiBarHeight, barWidth * 0.8, cpiBarHeight); ctx.fillStyle = '#333'; ctx.fillText('CPI: $' + cpi.toFixed(4), padding + barWidth * 0.5, canvas.height – padding – cpiBarHeight – 5); // Draw CPM Bar var cpmBarHeight = (cpm / maxValue) * chartHeight; ctx.fillStyle = 'rgba(40, 167, 69, 0.6)'; ctx.fillRect(padding + barWidth * 1.5, canvas.height – padding – cpmBarHeight, barWidth * 0.8, cpmBarHeight); ctx.fillStyle = '#333'; ctx.fillText('CPM: $' + cpm.toFixed(2), padding + barWidth * 1.5, canvas.height – padding – cpmBarHeight – 5); // Draw X-axis labels ctx.textAlign = 'center'; ctx.fillText('Cost Per Impression', padding + barWidth * 0.5, canvas.height – padding + 20); ctx.fillText('Cost Per Mille', padding + barWidth * 1.5, canvas.height – padding + 20); } // Replace updateChart function with drawCanvasChart if not using Chart.js // function updateChart(adSpend, impressions, cpm) { // var costPerImpression = adSpend / impressions; // drawCanvasChart(costPerImpression, cpm); // } */

Leave a Comment