Documentation
¶
Overview ¶
Package analyze defines the analyzer pipeline: the Issue/Severity types, the Analyzer interface every check implements, and a Registry to hold them. Analyzers consume a crawler.Result and emit Issues; they never fetch the crawl themselves. This single seam is how new SEO/SEA checks are added without touching the engine.
Index ¶
Constants ¶
const InstanceKey = "instance"
InstanceKey is the Data key an analyzer sets when it emits several findings that share one (Analyzer, Code, URL) — a site-wide rollup raised once per schema.org type, say. Its string value joins the finding's identity when two crawls are compared, so those findings stay distinct instead of collapsing into one. Findings without it keep the three-part identity, which is why adding it to an existing code re-keys that code against saved reports.
Variables ¶
This section is empty.
Functions ¶
func CanonicalURL ¶ added in v0.8.0
CanonicalURL returns the URL a page declares as its canonical, resolved against its final URL, or the final URL itself when it declares none or the href does not parse. Site-wide counts key on it so that one product reached at /products/<h> and again at /collections/<c>/products/<h> counts as the single page it is. Compare two results through URLKey, not ==.
func DeclaredCanonical ¶ added in v0.8.0
DeclaredCanonical returns the page's <head> link[rel="canonical"] href resolved against the page's final URL, or "" when the page declares none or the href does not parse. Resolution matters: a theme emitting a relative href="/products/tee" would otherwise never equal the absolute URL it is compared with. Only <head> is searched, matching the seo analyzer, because search engines ignore a canonical in <body>. Callers that need to tell "no canonical" apart from "self-canonical" use this; callers that only need the page's identity use CanonicalURL.
func SiteBase ¶ added in v0.8.0
SiteBase returns the scheme://host of the crawl, derived from the seed or, failing that, from the first crawled page's final URL. Analyzers that aggregate a finding across the whole crawl — a server configuration, a CMS fingerprint, a template-wide schema gap — use it as the issue URL, so one site-wide fact does not repeat on every page of the report.
Types ¶
type Analyzer ¶
type Analyzer interface {
Name() string
Description() string
Analyze(ctx context.Context, result *crawler.Result) []Issue
}
Analyzer is a single check. Implementations must be safe for sequential reuse.
type Issue ¶
type Issue struct {
Analyzer string `json:"analyzer"`
URL string `json:"url"`
Severity Severity `json:"severity"`
Code string `json:"code"`
Message string `json:"message"`
Data map[string]any `json:"data,omitempty"`
}
Issue is a single finding emitted by an analyzer.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds analyzers in registration order.
func (*Registry) Register ¶
Register adds an analyzer. A later registration with the same name replaces the earlier.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aeo assesses Answer Engine Optimization: how well a page is structured to be surfaced as a direct answer in featured snippets, "People Also Ask", and voice results.
|
Package aeo assesses Answer Engine Optimization: how well a page is structured to be surfaced as a direct answer in featured snippets, "People Also Ask", and voice results. |
|
Package amp implements AMP page detection, required-markup checks, and amphtml link validation against the crawled page set.
|
Package amp implements AMP page detection, required-markup checks, and amphtml link validation against the crawled page set. |
|
Package botwall detects when a crawl was served a CAPTCHA or bot-protection challenge instead of the real page — reCAPTCHA, hCaptcha, Cloudflare Turnstile, and the full-page interstitials of Cloudflare, DataDome, AWS WAF, PerimeterX/HUMAN, and Imperva Incapsula.
|
Package botwall detects when a crawl was served a CAPTCHA or bot-protection challenge instead of the real page — reCAPTCHA, hCaptcha, Cloudflare Turnstile, and the full-page interstitials of Cloudflare, DataDome, AWS WAF, PerimeterX/HUMAN, and Imperva Incapsula. |
|
Package consent audits how a site asks for, and behaves before, visitor consent to tracking.
|
Package consent audits how a site asks for, and behaves before, visitor consent to tracking. |
|
Package content implements cross-page content analysis: thin content and pages whose word count falls well below the crawl-wide average.
|
Package content implements cross-page content analysis: thin content and pages whose word count falls well below the crawl-wide average. |
|
Package datalayer audits Google Tag Manager / gtag wiring and the dataLayer event stream.
|
Package datalayer audits Google Tag Manager / gtag wiring and the dataLayer event stream. |
|
Package duplicates implements cross-page duplicate detection: identical body content, titles, and meta descriptions across the crawl.
|
Package duplicates implements cross-page duplicate detection: identical body content, titles, and meta descriptions across the crawl. |
|
Package geo assesses Generative Engine Optimization: whether AI answer engines (ChatGPT, Perplexity, Google AI Overviews, Gemini, Claude) can access the site and trust its content enough to cite it.
|
Package geo assesses Generative Engine Optimization: whether AI answer engines (ChatGPT, Perplexity, Google AI Overviews, Gemini, Claude) can access the site and trust its content enough to cite it. |
|
Package hreflang implements hreflang annotation validity, self-reference, x-default, and return-link reciprocity checks across the crawled page set.
|
Package hreflang implements hreflang annotation validity, self-reference, x-default, and return-link reciprocity checks across the crawled page set. |
|
Package httpx implements HTTP-level checks: status codes, redirect chains and loops, slow responses, and mixed content.
|
Package httpx implements HTTP-level checks: status codes, redirect chains and loops, slow responses, and mixed content. |
|
Package images implements image checks: alt-text state (missing, empty, present), duplicate and filename-derived alt text, non-descriptive filenames, and missing width/height dimension attributes.
|
Package images implements image checks: alt-text state (missing, empty, present), duplicate and filename-derived alt text, non-descriptive filenames, and missing width/height dimension attributes. |
|
Package landing assesses paid-campaign landing pages: how well the page's title and headings reflect the campaign keywords (utm_term / utm_campaign / utm_content), plus the quality-score signals ads care about (title, H1, meta description, indexability, HTTPS).
|
Package landing assesses paid-campaign landing pages: how well the page's title and headings reflect the campaign keywords (utm_term / utm_campaign / utm_content), plus the quality-score signals ads care about (title, H1, meta description, indexability, HTTPS). |
|
Package links implements link analysis: broken internal links, links to redirects, nofollow and external link reporting, and empty anchor detection.
|
Package links implements link analysis: broken internal links, links to redirects, nofollow and external link reporting, and empty anchor detection. |
|
Package pagination implements rel=next/prev pagination sequence detection and broken-target checks against the crawled page set.
|
Package pagination implements rel=next/prev pagination sequence detection and broken-target checks against the crawled page set. |
|
Package perf reports Core Web Vitals from headless-rendered pages.
|
Package perf reports Core Web Vitals from headless-rendered pages. |
|
Package robotscheck reports on robots.txt: presence, declared sitemaps, and crawled URLs that violate disallow rules.
|
Package robotscheck reports on robots.txt: presence, declared sitemaps, and crawled URLs that violate disallow rules. |
|
Package schemaorg parses the JSON-LD embedded in an HTML page into a flat, addressable graph of typed nodes.
|
Package schemaorg parses the JSON-LD embedded in an HTML page into a flat, addressable graph of typed nodes. |
|
Package seaurl parses UTM campaign parameters from URLs.
|
Package seaurl parses UTM campaign parameters from URLs. |
|
Package security implements security checks.
|
Package security implements security checks. |
|
Package seo implements technical on-page SEO checks (title, meta, canonical, headings, language, viewport, charset, social tags).
|
Package seo implements technical on-page SEO checks (title, meta, canonical, headings, language, viewport, charset, social tags). |
|
Package shopify detects Shopify storefronts and runs Shopify-specific checks: which schema each page template should carry and does not, structured data injected by two competing sources, product markup that flattens away its variants, and the crawlable utility and faceted URLs Shopify generates by default.
|
Package shopify detects Shopify storefronts and runs Shopify-specific checks: which schema each page template should carry and does not, structured data injected by two competing sources, product markup that flattens away its variants, and the crawlable utility and faceted URLs Shopify generates by default. |
|
Package sitemap discovers and parses sitemap.xml (including sitemap indexes) and cross-checks declared URLs against what was actually crawled.
|
Package sitemap discovers and parses sitemap.xml (including sitemap indexes) and cross-checks declared URLs against what was actually crawled. |
|
Package structured extracts and reports on JSON-LD structured data (schema.org): which types a page declares, whether they carry the fields their rich results require, whether the markup contradicts itself or the page it sits on, and which pages look like they are missing markup they should have.
|
Package structured extracts and reports on JSON-LD structured data (schema.org): which types a page declares, whether they carry the fields their rich results require, whether the markup contradicts itself or the page it sits on, and which pages look like they are missing markup they should have. |
|
Package tracking detects marketing and analytics tags on a page — Google Tag Manager, GA4, Universal Analytics, Google Ads, Meta (Facebook) Pixel, and a few others — and flags missing or duplicated installs.
|
Package tracking detects marketing and analytics tags on a page — Google Tag Manager, GA4, Universal Analytics, Google Ads, Meta (Facebook) Pixel, and a few others — and flags missing or duplicated installs. |
|
Package urls implements URL hygiene checks: uppercase letters, underscores, non-ASCII characters, and excessive length.
|
Package urls implements URL hygiene checks: uppercase letters, underscores, non-ASCII characters, and excessive length. |
|
Package utm audits UTM campaign tagging on a page's outbound links: partial tagging, empty or duplicated parameters, inconsistent key casing, and a per-page rollup.
|
Package utm audits UTM campaign tagging on a page's outbound links: partial tagging, empty or duplicated parameters, inconsistent key casing, and a per-page rollup. |
|
Package wordpress fingerprints WordPress sites and runs WordPress-specific checks that the generic analyzers do not name.
|
Package wordpress fingerprints WordPress sites and runs WordPress-specific checks that the generic analyzers do not name. |