WritedocsWritedocs

Integrations

integrations turns on an analytics service or a chat widget by name. Give it the ID from your account, and the service’s script is added to every page:

{
  "integrations": {
    "ga4": { "measurementId": "G-XXXXXXXXXX" }
  }
}

Turn on as many as you need - two analytics services at once while you move from one to the other, for example.

Google Analytics 4

{ "integrations": { "ga4": { "measurementId": "G-XXXXXXXXXX" } } }
measurementId string required

The G- ID of your property’s web data stream.

Google Tag Manager

{ "integrations": { "googleTagManager": { "containerId": "GTM-XXXXXXX" } } }
containerId string required

The GTM- ID of your container.

If Google Analytics already runs through your Tag Manager container, don’t turn on ga4 too - every page view would count twice.

Plausible

{ "integrations": { "plausible": { "domain": "docs.example.com" } } }
domain string required

The site’s domain, as you added it in Plausible.

src string default: https://plausible.io/js/script.js

The script’s address - for a self-hosted Plausible, your server’s.

Fathom

{ "integrations": { "fathom": { "siteId": "ABCDEFGH" } } }
siteId string required

The site ID from your Fathom dashboard.

PostHog

{ "integrations": { "posthog": { "apiKey": "phc_xxxxxxxxxxxxxxxxxxxx" } } }
apiKey string required

Your project’s API key (phc_...).

apiHost string default: https://us.i.posthog.com

PostHog’s address. For the EU cloud, https://eu.i.posthog.com; for a self-hosted PostHog, your server’s.

Umami

{ "integrations": { "umami": { "websiteId": "11111111-2222-3333-4444-555555555555" } } }
websiteId string required

The website ID Umami gave your site.

src string default: https://cloud.umami.is/script.js

The script’s address - for a self-hosted Umami, your server’s.

Writedocs analytics

Sites published on Writedocs come with Writedocs analytics: what readers search for, where they click and scroll, and how the pages perform. There’s nothing to set up. The platform turns it on when it publishes your site - you don’t add anything to your writedocs.json.

How it works:

  • Every page loads the analytics script in its <head>. It sets no cookies.
  • Each page is tagged with its version and language, so you can compare them in one site: v2, pt-br, or both joined with a dot, v2.pt-br. The tag comes from the version and language of the navigation item the page is in - not from its label. A page in no version and no language has no tag.
  • A tag has to fit a rule: up to 50 characters of lowercase letters, digits, ., _ and -, not starting with -. Capitals become lowercase (pt-BR is tagged pt-br). A version or language that doesn’t fit - one with a space, like "Version 2", or an accent - is left out of the tag, and the page is tagged with the other one alone, or not at all.
  • Moving between pages keeps the tags right: the site changes pages without reloading, and each page tells the analytics its own tag.
  • The consent banner holds it back too: with consent on, Writedocs analytics loads only once the reader accepts, like the services above.
  • Readers who turn on their browser’s Global Privacy Control aren’t measured.
  • A reader can opt out in their browser: wca.optOut() turns Writedocs analytics off there, and wca.optIn() turns it back on. Call it from a link or button of your own - a script in scripts, say.
  • writedocs dev doesn’t load it - visits while you write aren’t counted. It’s only on the published site.
  • API pages report their Try it requests - which operation, and how it went, never what was sent. See Requests in Writedocs analytics.

Page feedback

On a site published on Writedocs, each page can end with Was this page helpful? and a Yes and a No. You turn it on in the Writedocs dashboard, in your project’s analytics settings - an Owner or an Admin can - and it’s on from the next publish. You don’t add anything to your writedocs.json.

What the reader sees:

  • The question at the end of the page, above Previous and Next. A choice opens a box for a comment - optional, up to 1,000 characters - and a Send button. The reader is asked not to include personal information.
  • One answer per page per visit. A reader who chooses and leaves without pressing Send still has the choice counted, without the comment. Back on the page in the same visit, they see the thanks instead of the question.
  • It’s on reading pages: the default, wide and frame page modes, and the API pages. Not on custom or blank pages, nor on a Scalar API reference.
  • It isn’t part of the page’s content: it’s left out of search, of the Markdown copy of each page, of llms.txt and llms-full.txt, and of what the MCP server returns.
  • In the page’s language: the language of its section in the navigation (languages). The question and its buttons come in English, Portuguese, Spanish, French, German, Italian, Japanese, Korean and Chinese (Simplified and Traditional); pages in any other language show them in English.
  • It doesn’t wait for the consent banner: it’s a question the reader answers, not tracking. It sets no cookies.
  • It isn’t in writedocs dev: the question shows only on the published site.
  • Turned off after a publish, the question disappears the first time a reader answers it.

What’s kept: the page, the choice and the comment. Before it’s stored, an email address in the comment is replaced with [email], and a number of six or more digits - a card, a phone number, an account - with [number]. Answers are kept for 13 months.

Fields the platform sets

When the WriteDocs platform builds your site, it sets two fields of integrations itself, in the copy of writedocs.json it builds from. Your own writedocs.json - in the dashboard or in your repository - stays as it is. Your editor may suggest them, since the schema lists every field, but they aren’t for you to write:

  • analytics holds your project’s key for WriteDocs analytics. The platform adds it while WriteDocs analytics is on for your project. Leave it out of your writedocs.json: if the field is there, the platform keeps what you wrote and doesn’t add its own key.
  • pageFeedback follows the page feedback setting of your project, at every build: true while it’s on, and left out while it’s off - even when your writedocs.json has it. Writing it changes nothing; turn page feedback on or off in the dashboard.

Ask AI

A chat bubble on every page, where readers ask questions and get answers from your docs. It’s powered by DocsBot: create a bot there, point it at your published site, and give its ID here.

{ "integrations": { "askAi": { "id": "yourTeamId/yourBotId" } } }
id string required

The teamId/botId value from your bot’s embed code, in DocsBot’s dashboard - one value, with the slash.

The widget loads last, after everything else on the page.

On the WriteDocs platform, the WriteDocs team can also set the ID for your project. An askAi in your writedocs.json takes precedence.

The ID isn’t a secret: it’s in the HTML of every page, where any visitor can read it.

By default, analytics load with every page. consent asks the reader first: a banner along the bottom of the window, with Accept and Decline. Nothing from the analytics services above - Writedocs analytics included - loads until the reader accepts.

{
  "integrations": {
    "ga4": { "measurementId": "G-XXXXXXXXXX" },
    "consent": true
  }
}

true uses the default texts. To write your own, or link your privacy policy, give an object:

{
  "integrations": {
    "ga4": { "measurementId": "G-XXXXXXXXXX" },
    "consent": {
      "message": "We use cookies to see which pages help and which don't.",
      "acceptLabel": "Accept",
      "declineLabel": "No thanks",
      "policyUrl": "/docs/privacy/",
      "policyLabel": "Privacy policy"
    }
  }
}
message string default: We use cookies to understand how this site is used and to improve it.

The banner’s text.

acceptLabel string default: Accept

The accept button’s text.

declineLabel string default: Decline

The decline button’s text.

policyUrl string

A link after the message: a page on the site, or a full URL. Without it, there’s no link.

policyLabel string default: Privacy policy

The link’s text.

How it works:

  • Accept loads the analytics right away, and on every later page and visit without asking again.
  • Decline loads nothing, and the banner doesn’t come back.
  • The answer is kept in the reader’s browser, so it’s asked once per browser. A reader who clears their browser’s data is asked again.
  • The Ask AI widget isn’t held back - it’s a tool the reader chooses to open, not analytics.

Changing the answer

A link to #cookie-settings, anywhere on the site, opens the banner again. The footer is the usual place:

{
  "footer": {
    "columns": [
      {
        "title": "Legal",
        "links": [{ "label": "Cookie settings", "href": "#cookie-settings" }]
      }
    ]
  }
}

In a page, it’s an ordinary link: [Cookie settings](#cookie-settings). A reader who accepted and then declines gets the page reloaded, without the analytics. writedocs broken-links counts these links as working while integrations.consent is on, and reports them when it’s off - there’s no banner for them to open.

Your own scripts

A script in scripts waits for the same answer with "consent": true:

{
  "scripts": {
    "body": [{ "src": "https://tracker.example.com/t.js", "consent": true }]
  }
}

For code of your own that depends on the answer, window.wdConsent.get() returns "granted", "denied", or null before the reader has answered, and the page fires a wd:consent event when they do:

document.addEventListener("wd:consent", (event) => {
  if (event.detail === "granted") startSessionRecording();
});

Limits

  • The banner has one set of texts - on a site in several languages, it’s the same in all of them.
  • It’s accept or decline for everything: there are no categories to choose from.
  • It doesn’t send Google’s consent signals. Google Analytics and Tag Manager simply aren’t loaded until the reader accepts.
  • Whether your site needs a banner, and what it must say, depends on the laws that apply to you - Writedocs can’t decide that.

What isn’t covered

For a service that isn’t listed here, add its own snippet with scripts - with "consent": true if it should wait for the reader’s answer.