SEO Optimization Suggestion Tool

SEO Optimization Suggestion Tool

Get actionable recommendations to improve your on-page SEO.

This is a demo. Try: `https://example.com/needs-work`

SEO Optimization Report

Analyzed URL:
Report Date:

Actionable Recommendations

Category Score Breakdown

Category Score Breakdown Chart

This chart visualizes the performance across key SEO categories.

No issues found in this category.

'; if (categoryItems.length > 0) { itemsHtml = categoryItems.map(s => `

${s.text}

`).join(''); } detailedSuggestions.insertAdjacentHTML('beforeend', `

${category} Analysis

${itemsHtml}
`); }); } function renderChart(scores) { const ctx = document.getElementById('score-chart').getContext('2d'); if (scoreChart) scoreChart.destroy(); scoreChart = new Chart(ctx, { type: 'radar', data: { labels: Object.keys(scores), datasets: [{ label: 'Category Score', data: Object.values(scores), backgroundColor: 'rgba(29, 78, 216, 0.2)', borderColor: 'rgba(29, 78, 216, 1)', borderWidth: 2 }] }, options: { responsive: true, scales: { r: { beginAtZero: true, max: 100, ticks: { stepSize: 25 } } }, plugins: { legend: { display: false } } } }); } // --- EVENT HANDLERS --- analyzeBtn.addEventListener('click', analyzeUrl); downloadPdfBtn.addEventListener('click', generatePdf); // --- TABS & NAVIGATION --- const formatUSD = (val) => `$${(val || 0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`; // --- PDF GENERATION --- async function generatePdf() { const { jsPDF } = window.jspdf; const pdfReportElement = document.getElementById('pdf-report'); document.getElementById('pdf-url').textContent = lastAnalysis.url; document.getElementById('pdf-date').textContent = new Date().toLocaleDateString('en-US'); const pdfRecs = document.getElementById('pdf-recommendations'); pdfRecs.innerHTML = lastAnalysis.suggestions.map(s => `

[${s.priority}] ${s.text}

`).join('') || '

No specific issues found.

'; document.getElementById('pdf-chart-image').src = scoreChart.toBase64Image(); const canvas = await html2canvas(pdfReportElement, { scale: 2 }); const imgData = canvas.toDataURL('image/jpeg', 0.85); const pdf = new jsPDF('p', 'mm', 'a4'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'JPEG', 0, 0, pdfWidth, pdfHeight); pdf.save(`SEO-Report-${lastAnalysis.url.replace(/https?:\/\//, '')}.pdf`); } // --- INITIALIZATION --- init(); function init() { urlInput.value = 'https://example.com/needs-work'; analyzeUrl(); } });
Scroll to Top