Install on a plain HTML site

Use this guide for any site where you can edit the page <head>: hand-written HTML, a static site generator, a CMS theme, or a site builder with a “custom code” setting.

Copy the line

In the portal, open Settings → Install and copy the line under HTML. It looks like this, with your own site key:

<script defer src="https://analytics.writechoice.io/s/YOUR_SITE_KEY.js"></script>

Paste it in the head of every page

Paste it inside the <head> of every page of the site. If your site uses a shared layout or template, add it there once:

<head>
  <meta charset="utf-8" />
  <title>My site</title>
  <script defer src="https://analytics.writechoice.io/s/YOUR_SITE_KEY.js"></script>
</head>

Publish the site

Then check that it works.

Notes

  • Add the script only once per page. Loading it twice doesn’t count visits twice, but there’s no reason to.
  • Keep the defer attribute, so the script never delays your page.
  • The same line works on every domain and subdomain where you place it. The domain registered for the site doesn’t restrict where the script runs; it’s the address the Heatmaps tab uses for the page preview, so keep it set to the domain readers use.
  • If your server sends X-Frame-Options or a frame-ancestors directive, the Heatmaps tab draws the clicks on a blank background. See Heatmap preview.

If your site has a search box, call wca.search from your search code to record what readers look for. See Site search.