Skip to Content
API DocumentSearch, SEO and Analytics

Search, SEO, Redirects and Analytics

Search for readers

Every published document has a search box. Readers press Ctrl K (⌘ K on a Mac) or /, or click the Search… field: in the top bar in the Clover theme, under the document name in the other themes, and as an icon on a phone.

The search dialog of a published document

Results come from the version being read, in two groups:

  • Documentation: Markdown pages, matched by title, path and headings.
  • API reference: operations and schemas of the OpenAPI documents. Choosing an operation opens the reference at that operation.

A reader only finds what they may open: search follows the access of the version.

Page titles and descriptions

Each page has its own browser tab title, <page title> - <site name>:

  • For a Markdown page, the page title is its first # heading, or its name in the navigation when the file has none.
  • For an API reference, it is the title of the API.

The description of a page is its first paragraph. Where a page has none, the Site description from the General panel of the site settings is used. It has at most 300 characters.

Search engine settings

The SEO panel of the site settings has Ask search engines not to list this site. It adds a noindex instruction to every page of the site, for every published version.

On your own domain the panel’s Social image and Verification tags apply too, and the site gets a sitemap; see Search engines on your own domain.

Redirects

When you rename or move a page, or remove a version, links to the old address would end on a “not found” page. A redirect sends readers of the old address to the new one.

Add rules in the Redirects panel of the site settings with Add redirect. Each rule has a From and a To:

FromToEffect
/v1/guide/old.md/v2/guide/new.mdOne page moved
/v1/*/v2/*Everything below /v1/ leads to the same path below /v2/
/legacy/*https://docs.example.com/archive/*Everything below /legacy/ leads to another site
FieldRule
FromA path from the root of the site, starting with / and including the version, such as /v1/guide/old.md. It may end in /* to cover everything below a path
ToA path of the site, or an https:// address. When From ends in /*, a * at the end of To receives the rest of the old path; an https:// address with a * must end in /*
  • A rule applies only when no page exists at the old address, so a rule can never hide a live page.
  • An exact rule wins over a wildcard rule, and the longest matching wildcard wins over a shorter one.
  • Up to 200 rules. Two rules cannot share a From, and rules cannot form a loop.
  • The rules belong to the site, not to a version: one list covers the addresses of every version.

Google Analytics

To measure your readers with your own Google Analytics 4 property, enter its measurement ID (it looks like G-XXXXXXXXXX) in the Analytics panel of the site settings.

  • Page views are counted by Google Analytics’ own page tracking. Keep Page views switched on under Enhanced measurement in your GA4 data stream (it is on by default); otherwise only the first page of a visit is counted.
  • Every reader is counted, your own team included.
  • A shared link or a preview is not counted.
  • Your ID measures your published document only. It receives nothing from other pages of APIGit.

If your readers are in a region that requires consent for analytics cookies, that consent is yours to collect. The published document does not show a cookie banner.

Last updated on