Thuta Learning
AdvancedWeb Developmentintermediate

SEO, Logs, and Web Vitals

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Build an SEO technical baseline
  • Distinguish useful logs from sensitive data
  • Monitor Web Vitals

If you only find out about an error from a user telling you about it after deploy, you're already fixing it late. A production app needs both metadata for search engines and logs/metrics for developers.

The key idea

Keep title, description, canonical URL, sitemap, robots, and Open Graph image aligned with your route structure. In error logs, include what's needed for debugging like request context and the error digest — but never include passwords, tokens, cookies, or personal content. Use useReportWebVitals or your hosting provider's analytics to monitor LCP, INP, and CLS from real users, and compare before and after each release.

Let's try it together

tsx
"use client";
import { useReportWebVitals } from "next/web-vitals";

export function WebVitals() {
  useReportWebVitals((metric) => {
    navigator.sendBeacon(
      "/api/vitals",
      JSON.stringify({ name: metric.name, value: metric.value }),
    );
  });
  return null;
}

How the code works

The WebVitals component can send each metric to an analytics endpoint as it arrives from the browser. In production, you'll also need to think about sampling, retries, and privacy policy.

You should see
The browser can send Web Vitals metrics to a monitoring endpoint.

5-Minute Try-It

Write a monitoring plan for a production dashboard that shows error rate, LCP, and deployment version all in one place.

Next.js — Production ChecklistNext.js

Easy traps

  • Putting full tokens or user content into logs
  • Watching a metric spike without tying it to a deployment version

Exercise

Write a monitoring plan for a production dashboard that shows error rate, LCP, and deployment version all in one place.

You'll know it worked when: The browser can send Web Vitals metrics to a monitoring endpoint.

SEO, Logs, and Web Vitals | Thuta Learning