[{"data":1,"prerenderedAt":20},["ShallowReactive",2],{"clay-page:\u002F4.x\u002Ffeatures\u002Fanalytics":3},{"html":4,"toc":5,"description":16,"hero":17,"list":18,"socialImage":19},"\u003Ch1 id=\"analytics\">Analytics \u003Cspan class=\"badge badge-sm badge-soft badge-success clay-badge\">New in Clay 4\u003C\u002Fspan>\u003C\u002Fh1>\n\u003Cp>Which pages are read, and what readers search for without finding it: analytics shows where the docs help and where they fall short. Clay works with three services that set no cookies and keep no personal data: \u003Ca href=\"https:\u002F\u002Fplausible.io\" target=\"_blank\" rel=\"noopener noreferrer\">\u003Ci class=\"fa-solid fa-arrow-up-right-from-square clay-external-icon\" aria-hidden=\"true\">\u003C\u002Fi>Plausible\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fumami.is\" target=\"_blank\" rel=\"noopener noreferrer\">\u003Ci class=\"fa-solid fa-arrow-up-right-from-square clay-external-icon\" aria-hidden=\"true\">\u003C\u002Fi>Umami\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fwww.goatcounter.com\" target=\"_blank\" rel=\"noopener noreferrer\">\u003Ci class=\"fa-solid fa-arrow-up-right-from-square clay-external-icon\" aria-hidden=\"true\">\u003C\u002Fi>GoatCounter\u003C\u002Fa>. Each can be used as a hosted service or run on your own server.\u003C\u002Fp>\n\u003Cdiv class=\"clay-tabs\" data-tabs=\"\">\u003Cdiv role=\"tablist\" class=\"tabs tabs-border not-prose\">\u003Cbutton type=\"button\" role=\"tab\" id=\"clay-tabs-1-0\" class=\"tab tab-active\" aria-controls=\"clay-tabs-1-0-panel\" aria-selected=\"true\" tabindex=\"0\">Plausible\u003C\u002Fbutton>\u003Cbutton type=\"button\" role=\"tab\" id=\"clay-tabs-1-1\" class=\"tab\" aria-controls=\"clay-tabs-1-1-panel\" aria-selected=\"false\" tabindex=\"-1\">Umami\u003C\u002Fbutton>\u003Cbutton type=\"button\" role=\"tab\" id=\"clay-tabs-1-2\" class=\"tab\" aria-controls=\"clay-tabs-1-2-panel\" aria-selected=\"false\" tabindex=\"-1\">GoatCounter\u003C\u002Fbutton>\u003C\u002Fdiv>\u003Cdiv role=\"tabpanel\" id=\"clay-tabs-1-0-panel\" class=\"clay-tab-panel\" aria-labelledby=\"clay-tabs-1-0\" data-label=\"Plausible\">\u003Cdiv class=\"code-block\">\u003Cpre class=\"shiki shiki-themes light-plus dark-plus\" style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4;--shiki-light-bg:#FFFFFF;--shiki-dark-bg:#1E1E1E\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">analytics\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  plausible\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: {}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cbutton type=\"button\" class=\"copy-code btn btn-sm btn-square btn-ghost\" title=\"Copy code\" aria-label=\"Copy code\">\u003Ci class=\"fa-solid fa-copy\">\u003C\u002Fi>\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003Cp>The site’s domain comes from \u003Ccode>siteURL\u003C\u002Fcode>; set \u003Ccode>domain\u003C\u002Fcode> if Plausible knows the site by another name. For your own server, set \u003Ccode>src\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cpre class=\"shiki shiki-themes light-plus dark-plus\" style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4;--shiki-light-bg:#FFFFFF;--shiki-dark-bg:#1E1E1E\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">analytics\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  plausible\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">    domain\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#A31515;--shiki-dark:#CE9178\">\"docs.example.com\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">    src\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#A31515;--shiki-dark:#CE9178\">\"https:\u002F\u002Fstats.example.com\u002Fjs\u002Fscript.js\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cbutton type=\"button\" class=\"copy-code btn btn-sm btn-square btn-ghost\" title=\"Copy code\" aria-label=\"Copy code\">\u003Ci class=\"fa-solid fa-copy\">\u003C\u002Fi>\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cdiv role=\"tabpanel\" id=\"clay-tabs-1-1-panel\" class=\"clay-tab-panel\" aria-labelledby=\"clay-tabs-1-1\" data-label=\"Umami\" hidden=\"\">\u003Cdiv class=\"code-block\">\u003Cpre class=\"shiki shiki-themes light-plus dark-plus\" style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4;--shiki-light-bg:#FFFFFF;--shiki-dark-bg:#1E1E1E\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">analytics\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  umami\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">    websiteId\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#A31515;--shiki-dark:#CE9178\">\"94db1cb1-74f4-4a40-ad6c-962362670409\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cbutton type=\"button\" class=\"copy-code btn btn-sm btn-square btn-ghost\" title=\"Copy code\" aria-label=\"Copy code\">\u003Ci class=\"fa-solid fa-copy\">\u003C\u002Fi>\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003Cp>For your own server, set \u003Ccode>src\u003C\u002Fcode>, e.g. \u003Ccode>https:\u002F\u002Fstats.example.com\u002Fscript.js\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003Cdiv role=\"tabpanel\" id=\"clay-tabs-1-2-panel\" class=\"clay-tab-panel\" aria-labelledby=\"clay-tabs-1-2\" data-label=\"GoatCounter\" hidden=\"\">\u003Cdiv class=\"code-block\">\u003Cpre class=\"shiki shiki-themes light-plus dark-plus\" style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4;--shiki-light-bg:#FFFFFF;--shiki-dark-bg:#1E1E1E\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">analytics\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  goatcounter\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">    code\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#A31515;--shiki-dark:#CE9178\">\"my-docs\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cbutton type=\"button\" class=\"copy-code btn btn-sm btn-square btn-ghost\" title=\"Copy code\" aria-label=\"Copy code\">\u003Ci class=\"fa-solid fa-copy\">\u003C\u002Fi>\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003Cp>\u003Ccode>code\u003C\u002Fcode> is the name of your site at \u003Ccode>my-docs.goatcounter.com\u003C\u002Fcode>. For your own server, set \u003Ccode>endpoint\u003C\u002Fcode>, e.g. \u003Ccode>https:\u002F\u002Fstats.example.com\u002Fcount\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fdiv>\u003C\u002Fdiv>\n\u003Cdiv class=\"markdown-alert markdown-alert-tip\">\n\u003Cp class=\"markdown-alert-title text-primary\">\u003Ci class=\"fa-solid fa-lightbulb mr-2\">\u003C\u002Fi>Tip\u003C\u002Fp>\n\u003Cp>This site counts with GoatCounter: \u003Ccode>goatcounter: {code: \"clay\"}\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fdiv>\n\u003Ch2 id=\"what-is-counted\">\u003Ca class=\"heading-anchor\" href=\"#what-is-counted\" aria-label=\"Link to this section\" data-route=\"#what-is-counted\">#\u003C\u002Fa>What is counted\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Page views\u003C\u002Fstrong>, also when readers move from page to page without the browser loading a new page.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Searches without results\u003C\u002Fstrong>, with what was searched for, a moment after the reader stops typing. These show what your docs are missing.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Copied code and prompts\u003C\u002Fstrong>, and the \u003Cstrong>page menu\u003C\u002Fstrong>: copying or opening a page as Markdown, and asking ChatGPT or Claude about it.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>To count page views only:\u003C\u002Fp>\n\u003Cdiv class=\"code-block\">\u003Cpre class=\"shiki shiki-themes light-plus dark-plus\" style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4;--shiki-light-bg:#FFFFFF;--shiki-dark-bg:#1E1E1E\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">analytics\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  plausible\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: {}\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--shiki-light:#800000;--shiki-dark:#569CD6\">  events\u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#000000;--shiki-dark:#D4D4D4\">: \u003C\u002Fspan>\u003Cspan style=\"--shiki-light:#0000FF;--shiki-dark:#569CD6\">false\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cbutton type=\"button\" class=\"copy-code btn btn-sm btn-square btn-ghost\" title=\"Copy code\" aria-label=\"Copy code\">\u003Ci class=\"fa-solid fa-copy\">\u003C\u002Fi>\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003Cp>In Plausible, events show up once you add them as goals, e.g. “Search without results”. Umami and GoatCounter list them on their own.\u003C\u002Fp>\n\u003Ch2 id=\"when-nothing-is-counted\">\u003Ca class=\"heading-anchor\" href=\"#when-nothing-is-counted\" aria-label=\"Link to this section\" data-route=\"#when-nothing-is-counted\">#\u003C\u002Fa>When nothing is counted\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>During \u003Ccode>clay dev\u003C\u002Fcode>\u003C\u002Fstrong>: analytics only runs in built sites.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>For readers who ask not to be tracked\u003C\u002Fstrong>: browsers with Global Privacy Control or Do Not Track turned on load no analytics at all.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"data-protection\">\u003Ca class=\"heading-anchor\" href=\"#data-protection\" aria-label=\"Link to this section\" data-route=\"#data-protection\">#\u003C\u002Fa>Data protection\u003C\u002Fh2>\n\u003Cdiv class=\"markdown-alert markdown-alert-note\">\n\u003Cp class=\"markdown-alert-title text-base-content\">\u003Ci class=\"fa-solid fa-sticky-note mr-2\">\u003C\u002Fi>Note\u003C\u002Fp>\n\u003Cp>This is an overview, not legal advice. Your site’s privacy policy and the rules that apply to it are yours to check.\u003C\u002Fp>\n\u003C\u002Fdiv>\n\u003Cp>In the EU, storing or reading anything on a reader’s device, like a cookie, needs their consent unless it is strictly necessary (the ePrivacy Directive, in Germany the TDDDG), and personal data such as IP addresses needs a legal basis under the GDPR.\u003C\u002Fp>\n\u003Cp>The three services are built so that this stays simple: they set no cookies and use nothing else on the reader’s device, and they do not store IP addresses or other personal data, only counts. That is why they are commonly used without a consent banner, on the basis of a legitimate interest. What remains for you:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Mention the service in your privacy policy\u003C\u002Fstrong>: what is counted, by whom, and why.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Sign the service’s data processing agreement\u003C\u002Fstrong>, when you use it as a hosted service. Plausible and GoatCounter are hosted in the EU; with your own server, the data never leaves it.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Search queries are text readers type.\u003C\u002Fstrong> If your readers might type personal data into the search, turn events off with \u003Ccode>events: false\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Services that set cookies, like Google Analytics, need consent before they load, and with it a consent banner. Clay does not ship one. If you need such a service, add its script with \u003Ca href=\"\u002Fclay-example-repo\u002F4.x\u002Fconfiguration\u002Fclay-yaml#head\" data-route=\"\u002F4.x\u002Fconfiguration\u002Fclay-yaml#head\">\u003Ccode>head\u003C\u002Fcode>\u003C\u002Fa> and a consent tool of your choice.\u003C\u002Fp>\n",[6,10,13],{"id":7,"text":8,"level":9},"what-is-counted","What is counted",2,{"id":11,"text":12,"level":9},"when-nothing-is-counted","When nothing is counted",{"id":14,"text":15,"level":9},"data-protection","Data protection","Count page views and learn what readers search for in vain, with services that set no cookies.",null,false,"\u002F_clay\u002Fsocial\u002F4.x\u002Ffeatures\u002Fanalytics.png",1792666369523]