1. Analyze the User's Request:
* Goal: Audit JavaScript SEO.
* Specific areas of focus:
* Render paths (CSR vs. SSR vs. SSG).
* Hydration timing (boot-up time, interaction delays).
* Blocked resources (robots.txt, internal linking).
* Indexation fixes per template (meta tags, canonicals, status codes).
* Context: The user hasn't provided any code or a URL. This is a generic request for a framework or a checklist to perform such an audit.
* Tone: Professional, technical, actionable.
-
Deconstruct the Key Areas:
- Render Paths:
- Problem: Googlebot renders JS, but it takes resources. CSR (Client-Side Rendering) is risky for critical content.
- Solution: Check HTML source vs. rendered DOM. Dynamic rendering vs. SSR/SSG.
- Hydration Timing:
- Problem: React/Vue/Angular apps can have large bundles. The page looks ready but isn't interactive (Total Blocking Time). Google measures interaction to next paint (INP) and potentially penalizes slow pages.
- Solution: Audit JS bundles, lazy loading, hydration strategies (islands architecture, partial hydration).
- Blocked Resources:
- Problem: If
robots.txt blocks JS/CSS, Google can't understand the layout or content.
- Solution: Check
robots.txt logic.
- Indexation Fixes per Template:
- Problem: SPA routing often handles links incorrectly (
onclick instead of <a>), or fails to handle meta tags dynamically.
- Solution: Inspect specific templates (Home, Product, Blog, Search). Check canonicals, status codes (soft 404s).
-
Structure the Response:
-
Since I can't see the actual site, I need to provide a comprehensive checklist and audit framework. I should structure it by the categories the user requested.
-
Section 1: Render Paths (The "How" content appears)
- Check: View Source vs. Inspect Element.
- Tool: Google Search Console (URL Inspection).
- Template Audit: CSR vs. SSR implementation.
- Fix: Dynamic Rendering (if SSR not possible) or hybrid.
-
Section 2: Hydration & Performance (The "When" content becomes interactive)
- Metric: INP (Interaction to Next Paint), TBT (Total Blocking Time).
- Check: Main thread blocking.
- Fix: Code splitting, deferring non-critical JS.
-
Section 3: Blocked Resources (Access control)
- Check:
robots.txt, X-Robots-Tag.
- Fix: Allow CSS/JS.
-
Section 4: Indexation Fixes per Template (The specific pages)
- Templates: Home, Listing (PLP), Detail (PDP), Static/Info.
- Key elements:
<title>, <meta name="description">, rel="canonical", hreflang.
- SPA issue: Soft 404s.
-
Section 5: Crawl Budget & Link Structure
- Issue:
onclick vs. <a>.
- Fix: Custom elements (e.g., Next.js
<Link>) rendered as standard HTML links.
-
Refining the Content (Self-Correction/Enhancement):
- Initial thought: Just list tools. Correction: No, the user asked for specific technical fixes per template. I need to give examples (e.g., "On a Product Page, ensure price is in the DOM, not fetched via AJAX 5 seconds later").
- Hydration nuance: Mention "Hydration mismatch" errors as they can break the UI for Googlebot if the rendered HTML differs too much from the SSR output.
- Code snippets: Provide examples of what good vs. bad looks like (e.g.,
<a> tags).
-
Drafting the Response (Iterative refinement):
- Intro: Acknowledge the complexity of JS SEO.
- Step 1 (Rendering): Use the "View Source" vs "Inspect" test. This is the gold standard.
- Step 2 (Hydration): Focus on the "Critical Request Chain". Mention
client:hover or lazy hydration.
- Step 3 (Blocked): Keep it brief but emphasize that Google needs to see the CSS to understand if content is hidden.
- Step 4 (Templates): Create a matrix.
- PDP (Product): Schema.org is crucial here.
- PLP (Listing): Pagination/Infinite scroll is the killer here.
- Step 5 (Links): The cardinal sin of JS SEO is
onclick routing.
-
Final Polish: Ensure the tone is authoritative. Use formatting (bolding, lists) to make it scannable. Add a "Quick Audit Checklist" at the end for immediate action.
-
Final Output Generation: (This matches the detailed response provided previously.)
- Self-Correction during drafting: I initially forgot to mention "Soft 404s" specifically in the context of SPAs (Single Page Applications). I must add that—if a user hits a bad URL, the SPA loads the shell (200 OK) but shows "Not Found" text. Google sees this as a Soft 404 unless status codes are handled in headers or the
noindex tag is injected dynamically.
-
Conclusion: The response is ready. It covers all four requested points with technical depth.
Since you haven't provided a specific URL or code repository, I have designed this response as a comprehensive Technical SEO Audit Framework specifically for JavaScript-heavy sites (React, Vue, Angular, Next.js, etc.).
You can use this checklist to audit your own site.
1. Render Paths (SSR vs. CSR vs. Dynamic Rendering)
The Goal: Ensure content is accessible to crawlers without requiring immediate execution.
The Audit Checks:
- The "View Source" vs. "Inspect" Test:
- Check: Right-click → View Page Source. Is the core content (text, links) present in the raw HTML?
- Check: Right-click → Inspect Element. Is the content visible in the DOM but missing from the Source?
- Diagnosis: If content is in Inspect but not Source, you are relying on Client-Side Rendering (CSR). Google can render this, but it is risky and delays indexing.
- Snapshot Verification:
- Use the Rich Results Test or Google Search Console URL Inspection.
- Does the screenshot show the fully loaded page?
- Does the HTML tab contain your H1, meta descriptions, and internal links?
- The Fix per Template:
- Product/Content Pages: Must use Server-Side Rendering (SSR) or Static Site Generation (SSG). Critical data must exist in the HTTP response.
- Filter/Facet Pages: If these are SEO-indexable, they must have unique URLs (not hash fragments
#) and render server-side.
- Legacy CSR Fix: If you cannot migrate to SSR/SSG, implement Dynamic Rendering (e.g., Rendertron or Snapkit) to serve pre-rendered HTML to bots.
2. Hydration Timing & Performance (Core Web Vitals)
The Goal: Ensure the interactive experience matches the visual load speed.
The Audit Checks:
- Total Blocking Time (TBT) / Interaction to Next Paint (INP):
- Are large JavaScript bundles blocking the main thread?
- Does the site "look" loaded but fail to register clicks for 2-3 seconds? (Hydration mismatch).
- Cumulative Layout Shift (CLS):
- Do elements shift around as JS injects content (e.g., fonts loading, dynamic ads, injected divs)?
- Largest Contentful Paint (LCP):
- Is your LCP element an image or text rendered via JS? If the client has to fetch data then render the image, LCP will be poor.
The Fix per Template:
- Streaming HTML: Use frameworks (like Next.js or Remix) that support streaming HTML. Send the shell first, then stream the content as it resolves.
- Selective Hydration: Prevent the entire app from hydrating at once. Only hydrate interactive components as the user scrolls or hovers.
- Skeleton Screens: Use CSS skeleton placeholders to reserve space for content before JS loads (fixes CLS).
3. Blocked Resources & Crawl Efficiency
The Goal: Ensure Googlebot can access the scripts needed to render the page.
The Audit Checks:
- Robots.txt Audit:
- Does your
robots.txt disallow /js/, /assets/, or /*.bundle.js?
- Critical: Googlebot must be able to fetch your JS files to render the page. If you block JS, you block rendering.
- Internal Linking Structure:
- The "onClick" Trap: Do you use
<div onclick="router.push('/about')">?
- Audit: Googlebot treats standard
<a href="..."> tags as links. It often ignores onclick events or proprietary router logic for discovery.
- Meta Robots:
- Is
noindex accidentally injected during the loading state (e.g., a generic "Loading..." component that has noindex set)?
The Fix per Template:
- Clean Links: Convert all navigational elements to standard
<a> tags. If using React/Vue, use the library's Link component (e.g., <Link to="...">), which renders an <a> tag in the DOM.
- Robots.txt: Explicitly allow JS and CSS files
Allow: /assets/js.
- Lazy Loading: Do not lazy-load critical SEO content (main text, H1) using IntersectionObserver. Ensure it is in the source.
4. Indexation Fixes Per Template Type
Specific fixes based on the type of page being rendered.
A. Listing / Category Pages (PLP)
- The Issue: Pagination and "Load More" buttons.
- The Fix:
- Avoid "Infinite Scroll" for SEO unless you implement a "PushState" strategy where scrolling updates the URL (
/page/2).
- Use
rel="next" and rel="prev" in the <head> (though Google deprecated this, other engines use it).
- Ensure filters update the URL. If filtering by "Red Shoes" doesn't change the URL to
?color=red, it cannot be indexed.
B. Detail Pages (PDP / Articles)
- The Issue: Duplicate Content and Data freshness.
- The Fix:
- Canonicals: Ensure
rel="canonical" is hard-coded in the <head> (preferably injected via SSR), not appended via JS after load.
- Structured Data (Schema): Do not inject Schema via
document.scripts. Ideally, inject via SSR or use the "yd" script injector. Google prefers JSON-LD present in the raw HTML or rendered DOM.
C. Single Page App (SPA) Routing
- The Issue: Soft 404s.
- The Fix:
- If a user navigates to a non-existent URL, the app loads the shell and displays a "Not Found" component.
- Status Code: Since it's a static file serve, the server returns
200 OK.
- Correction: Ensure the "Not Found" page includes
<meta name="robots" content="noindex">. If using SSR, explicitly return a 404 status header.
Summary Checklist for Your Code Review
| Element | Audit Question | Recommended Action |
|---|
<title> | Does it update immediately on route change? | Use react-helmet / vue-meta. Verify in GSC. |
<a> tags | Are they crawlable standard links? | Avoid <div onClick>. Use <a href>. |
| Meta Robots | Is it ever set to noindex by mistake? | Check "Loading" components for stray noindex. |
| Status Codes | Do errors return 404 headers? | Handle 404s server-side if using SSR. |
| JS Blocking | Is the main thread idle > 50ms? | Code split; defer non-critical third-party scripts. |
If you paste a specific URL or code snippet (like a package.json or a specific component file), I can give you a line-by-line audit.