CINXE.COM
<!doctype html> <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-stats-api" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.5.2"> <title data-rh="true">Stats API v2 reference | Plausible docs</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://plausible.io/docs/stats-api"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Stats API v2 reference | Plausible docs"><meta data-rh="true" name="description" content="Plausible Stats API v2 is a powerful single endpoint HTTP interface to view historical and real-time stats. In a nutshell, the endpoint /api/v2/query accepts both simple and complex stats queries in the POST request body and returns the metrics as JSON."><meta data-rh="true" property="og:description" content="Plausible Stats API v2 is a powerful single endpoint HTTP interface to view historical and real-time stats. In a nutshell, the endpoint /api/v2/query accepts both simple and complex stats queries in the POST request body and returns the metrics as JSON."><link data-rh="true" rel="icon" href="/docs/img/favicon.png"><link data-rh="true" rel="canonical" href="https://plausible.io/docs/stats-api"><link data-rh="true" rel="alternate" href="https://plausible.io/docs/stats-api" hreflang="en"><link data-rh="true" rel="alternate" href="https://plausible.io/docs/stats-api" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://7M80VX1X5C-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="Plausible docs" href="/docs/opensearch.xml"> <script src="/docs/js/tracking.js" defer="defer"></script><link rel="stylesheet" href="/docs/assets/css/styles.6412c14b.css"> <script src="/docs/assets/js/runtime~main.3f7bcfdc.js" defer="defer"></script> <script src="/docs/assets/js/main.90a19ee0.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a href="https://plausible.io/" target="_self" rel="noopener noreferrer" class="navbar__brand"><div class="navbar__logo"><img src="/docs/img/plausible_logo.svg" alt="Plausible logo" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/docs/img/plausible_logo.svg" alt="Plausible logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a><a class="navbar__item navbar__link" target="_self" href="/docs/">Docs</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/plausible/docs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/">Get Started</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/landing-page">Website Settings</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/guided-tour">Stats Dashboard</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/goal-conversions">Events, Funnels and Ecommerce</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/docs/stats-api">API</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" tabindex="0" href="/docs/stats-api">Stats API</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/stats-api">Reference</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/stats-api-playground">Playground</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/stats-api-v1">v1 API Reference</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/events-api">Events API reference</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/sites-api">Site provisioning API reference</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/proxy/introduction">Adblockers</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/2fa">Account Settings</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/trial-to-paid">Billing and Subscription</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/contribute">Contribute</a></div></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/docs/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">API</span><meta itemprop="position" content="1"></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Stats API</span><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Reference</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Stats API v2 reference</h1></header><p>Plausible Stats API v2 is a powerful single endpoint HTTP interface to <strong>view historical and real-time stats</strong>. In a nutshell, the endpoint <code>/api/v2/query</code> accepts both simple and complex stats queries in the POST request body and returns the metrics as JSON.</p> <p><a href="#examples">Try it now for your own site!</a></p> <div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>Not what you need?</div><div class="admonitionContent_BuS1"><p>Take a look at our <a href="/docs/events-api">Events API Reference</a> if you want to record pageviews or custom events for your sites, or <a href="/docs/sites-api">Sites API Reference</a> if you want to manage your sites over the API.</p></div></div> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="authentication">Authentication<a href="#authentication" class="hash-link" aria-label="Direct link to Authentication" title="Direct link to Authentication"></a></h2> <p>You can obtain an API key for your account by going to your user settings page <a href="https://plausible.io/settings" target="_blank" rel="noopener noreferrer">plausible.io/settings</a>.</p> <p>After creating a token, you can authenticate your request by sending the token in the Authorization header of your request.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="example-curl-request">Example curl request<a href="#example-curl-request" class="hash-link" aria-label="Direct link to Example curl request" title="Direct link to Example curl request"></a></h3> <p>In the following request, replace YOUR-TOKEN with a reference to your token and site_id value with your domain.</p> <div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token function" style="color:rgb(130, 170, 255)">curl</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--request</span><span class="token plain"> POST </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--header</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">'Authorization: Bearer YOUR-TOKEN'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--header</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">'Content-Type: application/json'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--url</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">'https://plausible.io/api/v2/query'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token parameter variable" style="color:rgb(191, 199, 213)">--data</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">'{ "site_id": "dummy.site", "metrics": ["visitors"], "date_range": "7d" }'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>API keys have a rate limit of 600 requests per hour by default. If you have special needs for more requests, please contact us to request more capacity.</p> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="request-structure">Request structure<a href="#request-structure" class="hash-link" aria-label="Direct link to Request structure" title="Direct link to Request structure"></a></h2> <p><code>/api/v2/query</code> endpoint accepts a <code>query</code> object. Example:</p> <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"site_id"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"dummy.site"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visitors"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"pageviews"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"bounce_rate"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"date_range"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"7d"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"filters"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"is_not"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"visit:country_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">""</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visit:country_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"visit:city_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>Query can contain the following keys:</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="site_id-">site_id <span style="color:#ED8936;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">REQUIRED</span><a href="#site_id-" class="hash-link" aria-label="Direct link to site_id-" title="Direct link to site_id-"></a></h3> <p>Domain of your site on Plausible to be queried.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="date_range">date_range <span style="color:#ED8936;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">REQUIRED</span><a href="#date_range" class="hash-link" aria-label="Direct link to date_range" title="Direct link to date_range"></a></h3> <p>Date range to be queried.</p> <table><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>["2024-01-01", "2024-07-01"]</code></td><td>Custom date range (ISO8601)</td></tr><tr><td><code>["2024-01-01T12:00:00+02:00", "2024-01-01T15:59:59+02:00"]</code></td><td>Custom date-time range (ISO8601)</td></tr><tr><td><code>"day"</code></td><td>Current day (e.g. 2024-07-01)</td></tr><tr><td><code>"7d"</code></td><td>Last 7 days relative to today</td></tr><tr><td><code>"30d"</code></td><td>Last 30 days relative to today</td></tr><tr><td><code>"month"</code></td><td>Since the start of the current month</td></tr><tr><td><code>"6mo"</code></td><td>Last 6 months relative to start of this month</td></tr><tr><td><code>"12mo"</code></td><td>Last 12 months relative to start of this month</td></tr><tr><td><code>"year"</code></td><td>Since the start of this year</td></tr><tr><td><code>"all"</code></td><td>Since the start of stats in Plausible</td></tr></tbody></table> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="metrics">metrics <span style="color:#ED8936;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">REQUIRED</span><a href="#metrics" class="hash-link" aria-label="Direct link to metrics" title="Direct link to metrics"></a></h3> <p>Metrics represent values to be calculated with the query.</p> <p>Valid metrics are:</p> <table><thead><tr><th>Metric name</th><th>Description</th></tr></thead><tbody><tr><td><code>visitors</code></td><td>The number of unique visitors</td></tr><tr><td><code>visits</code></td><td>The number of visits/sessions</td></tr><tr><td><code>pageviews</code></td><td>The number of pageview events</td></tr><tr><td><code>views_per_visit</code></td><td>The number of pageviews divided by the number of visits. Returns a floating point number.</td></tr><tr><td><code>bounce_rate</code></td><td>Bounce rate percentage</td></tr><tr><td><code>visit_duration</code></td><td>Visit duration in seconds</td></tr><tr><td><code>events</code></td><td>The number of events (pageviews + custom events). When filtering by a goal, this metric corresponds to "Total Conversions" in the dashboard.</td></tr><tr><td><code>percentage</code></td><td>The percentage of visitors of total who fall into this category: Requires: dimension list</td></tr><tr><td><code>conversion_rate</code></td><td>The percentage of visitors who completed the goal. Requires: dimension list passed, an event<!-- -->:goal<!-- --> filter or event<!-- -->:goal<!-- --> dimension</td></tr><tr><td><code>group_conversion_rate</code></td><td>The percentage of visitors who completed the goal with the same dimension. Requires: dimension list passed, an event<!-- -->:goal<!-- --> filter or event<!-- -->:goal<!-- --> dimension</td></tr></tbody></table> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="dimensions">dimensions <span style="color:#718096;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">optional</span><a href="#dimensions" class="hash-link" aria-label="Direct link to dimensions" title="Direct link to dimensions"></a></h3> <p>Default: <code>[]</code></p> <p>List of dimensions to group by. <a href="#example-utm">See example</a></p> <p>Dimensions are attributes of your dataset. Using them in queries enables analyzing and compare multiple groups against each other. Think of them as <code>GROUP BY</code> in SQL.</p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="event-dimensions">Event dimensions<a href="#event-dimensions" class="hash-link" aria-label="Direct link to Event dimensions" title="Direct link to Event dimensions"></a></h4> <p>Valid dimensions include:</p> <table><thead><tr><th>Dimension</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><code>event:goal</code></td><td>Register</td><td>A custom action that you want your users to take. To use this property, you first need to configure some goals in the <a href="/docs/website-settings">site settings</a>, or via the <a href="/docs/sites-api">Sites API</a>. The value is the goal's <code>display_name</code>. Learn more about goals <a href="/docs/goal-conversions">here</a>.</td></tr><tr><td><code>event:page</code></td><td>/blog/remove-google-analytics</td><td>Pathname of the page where the event is triggered. You can also use an asterisk to group multiple pages (<code>/blog*</code>)</td></tr><tr><td><code>event:hostname</code></td><td>example.com</td><td>Hostname of the event.</td></tr></tbody></table> <div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>Mixing session metrics <code>bounce_rate</code>, <code>views_per_visit</code> and <code>visit_duration</code> with event dimensions is not allowed.</p></div></div> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="visit-dimensions">Visit dimensions<a href="#visit-dimensions" class="hash-link" aria-label="Direct link to Visit dimensions" title="Direct link to Visit dimensions"></a></h4> <p>Values of these dimensions are determined by the first pageview in a session.</p> <table><thead><tr><th>Dimension</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><code>visit:entry_page</code></td><td>/home</td><td>Page on which the visit session started (landing page).</td></tr><tr><td><code>visit:exit_page</code></td><td>/home</td><td>Page on which the visit session ended (last page viewed).</td></tr><tr><td><code>visit:source</code></td><td>Twitter</td><td>Visit source, populated from an url query parameter tag (<code>utm_source</code>, <code>source</code> or <code>ref</code>) or the Referer HTTP header.</td></tr><tr><td><code>visit:referrer</code></td><td>t.co/fzWTE9OTPt</td><td>Raw <code>Referer</code> header without <code>http://</code>, <code>http://</code> or <code>www.</code>.</td></tr><tr><td><code>visit:channel</code></td><td>Organic Search</td><td>Acquisition channel for visit.</td></tr><tr><td><code>visit:utm_medium</code></td><td>social</td><td>Raw value of the <code>utm_medium</code> query param on the entry page.</td></tr><tr><td><code>visit:utm_source</code></td><td>twitter</td><td>Raw value of the <code>utm_source</code> query param on the entry page.</td></tr><tr><td><code>visit:utm_campaign</code></td><td>profile</td><td>Raw value of the <code>utm_campaign</code> query param on the entry page.</td></tr><tr><td><code>visit:utm_content</code></td><td>banner</td><td>Raw value of the <code>utm_content</code> query param on the entry page.</td></tr><tr><td><code>visit:utm_term</code></td><td>keyword</td><td>Raw value of the <code>utm_term</code> query param on the entry page.</td></tr><tr><td><code>visit:device</code></td><td>Desktop</td><td>Device type. Possible values are <code>Desktop</code>, <code>Laptop</code>, <code>Tablet</code> and <code>Mobile</code>.</td></tr><tr><td><code>visit:browser</code></td><td>Chrome</td><td>Name of the browser vendor. Most popular ones are <code>Chrome</code>, <code>Safari</code> and <code>Firefox</code>.</td></tr><tr><td><code>visit:browser_version</code></td><td>88.0.4324.146</td><td>Version number of the browser used by the visitor.</td></tr><tr><td><code>visit:os</code></td><td>Mac</td><td>Name of the operating system. Most popular ones are <code>Mac</code>, <code>Windows</code>, <code>iOS</code> and <code>Android</code>. Linux distributions are reported separately.</td></tr><tr><td><code>visit:os_version</code></td><td>10.6</td><td>Version number of the operating system used by the visitor.</td></tr><tr><td><code>visit:country</code></td><td>US</td><td>ISO 3166-1 alpha-2 code of the visitor country.</td></tr><tr><td><code>visit:region</code></td><td>US-MD</td><td>ISO 3166-2 code of the visitor region.</td></tr><tr><td><code>visit:city</code></td><td>4347778</td><td><a href="https://www.geonames.org/" target="_blank" rel="noopener noreferrer">GeoName ID</a> of the visitor.</td></tr><tr><td><code>visit:country_name</code></td><td>United States</td><td>Name of the visitor country.</td></tr><tr><td><code>visit:region_name</code></td><td>California</td><td>Name of the visitor region.</td></tr><tr><td><code>visit:city_name</code></td><td>San Francisco</td><td>Name of the visitor city.</td></tr></tbody></table> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="time-dimensions">Time dimensions<a href="#time-dimensions" class="hash-link" aria-label="Direct link to Time dimensions" title="Direct link to Time dimensions"></a></h4> <p>It's useful to be able to group data by time, which can be done via the following dimensions.</p> <table><thead><tr><th>Dimension</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><code>time</code></td><td>2024-01-01</td><td>Time or date to group by. Automatically figures out the appropriate time<!-- -->:bucket<!-- --> value from date range. Response is a valid ISO8601 date or timestamp</td></tr><tr><td><code>time:hour</code></td><td>2021-01-27T23:43:10Z</td><td>Time grouped by hour. ISO8601 timestamp</td></tr><tr><td><code>time:day</code></td><td>2021-01-27</td><td>Time grouped by date. ISO8601 date</td></tr><tr><td><code>time:week</code></td><td>2021-01-04</td><td>Time grouped by start of the week. ISO8601 date</td></tr><tr><td><code>time:month</code></td><td>2021-01-01</td><td>Time grouped by start of month. ISO8601 date</td></tr></tbody></table> <p>Note that:</p> <ul> <li><code>time</code> dimensions are not usable in filters. Set <a href="#date_range"><code>date_range</code></a> instead.</li> <li>If no data falls into a given time bucket, no values are returned. <a href="#time-labels">See <code>include.time_labels</code> option</a> for a workaround.</li> </ul> <p><a href="#example-timeseries">See example</a></p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="custom-properties">Custom properties<a href="#custom-properties" class="hash-link" aria-label="Direct link to Custom properties" title="Direct link to Custom properties"></a></h4> <p><a href="/docs/custom-props/introduction">Custom properties</a> can also be used as dimensions with the form <code>event:props:<custom_prop_name></code>. <a href="#example-custom-properties">See example</a></p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="filters-">filters <span style="color:#718096;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">optional</span><a href="#filters-" class="hash-link" aria-label="Direct link to filters-" title="Direct link to filters-"></a></h3> <p>Default: <code>[]</code></p> <p>Filters allow limiting the data analyzed in a query. <a href="#example-filtering">See example</a>.</p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="simple-filters">Simple filters<a href="#simple-filters" class="hash-link" aria-label="Direct link to Simple filters" title="Direct link to Simple filters"></a></h4> <p>Each simple filter takes the form of <code>[operator, dimension, clauses]</code>.</p> <h5 class="anchor anchorWithStickyNavbar_LWe7" id="operators">operators<a href="#operators" class="hash-link" aria-label="Direct link to operators" title="Direct link to operators"></a></h5> <p>The following operators are currently supported:</p> <table><thead><tr><th>Operator</th><th>Example</th><th>Explanation</th></tr></thead><tbody><tr><td><code>is</code></td><td><code>["is", "visit:country_name", ["Germany", "Poland"]]</code></td><td>Sessions originating from Germany or Poland.</td></tr><tr><td><code>is_not</code></td><td><code>["is_not", "event:page", ["/pricing"]]</code></td><td>Events that did not visit /pricing page</td></tr><tr><td><code>contains</code></td><td><code>["contains", "event:page", ["/login"]]</code></td><td>Events visited any page containing /login</td></tr><tr><td><code>contains_not</code></td><td><code>["contains_not", "event:page", ["docs", "pricing"]]</code></td><td>Events that did not visit any page containing docs or pricing</td></tr><tr><td><code>matches</code></td><td><code>["matches", "event:page", ["^/user/\d+$"]]</code></td><td>Events where page matches regular expression <code>^/user/\d+$</code>. <a href="https://github.com/google/re2/wiki/Syntax" target="_blank" rel="noopener noreferrer">Uses re2 syntax</a></td></tr><tr><td><code>matches_not</code></td><td><code>["matches", "event:page", ["^/user/\d+$"]]</code></td><td>Events where page does not match regular expression <code>^/user/\d+$</code>. <a href="https://github.com/google/re2/wiki/Syntax" target="_blank" rel="noopener noreferrer">Uses re2 syntax</a></td></tr></tbody></table> <h5 class="anchor anchorWithStickyNavbar_LWe7" id="dimension">dimension<a href="#dimension" class="hash-link" aria-label="Direct link to dimension" title="Direct link to dimension"></a></h5> <p><a href="#dimensions">Event and visit dimensions</a> are valid for filters.</p> <p>Note that only <code>is</code> operator is valid for <code>event:goal</code> dimension.</p> <h5 class="anchor anchorWithStickyNavbar_LWe7" id="clauses">clauses<a href="#clauses" class="hash-link" aria-label="Direct link to clauses" title="Direct link to clauses"></a></h5> <p>List of values to match against. A data point matches filter if <em>any</em> of the clauses matches.</p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="logical-operations">Logical operations<a href="#logical-operations" class="hash-link" aria-label="Direct link to Logical operations" title="Direct link to Logical operations"></a></h4> <p>Filters can be combined using <code>and</code>, <code>or</code> and <code>not</code> operators.</p> <table><thead><tr><th>Operator</th><th>Example</th><th>Explanation</th></tr></thead><tbody><tr><td><code>and</code></td><td><code>["and", [["is", "visit:country_name", ["Germany"]]], ["is", "visit:city_name", ["Berlin"]]]]</code></td><td>Sessions originating from Berlin, Germany</td></tr><tr><td><code>or</code></td><td><code>["and", [["is", "visit:country_name", ["Germany"]]], ["is", "visit:city_name", ["Tallinn"]]]]</code></td><td>Sessions originating from Germany or city of Tallinn</td></tr><tr><td><code>not</code></td><td><code>["not", ["is", "visit:country_name", ["Germany"]]]</code></td><td>Sessions not originating from Germany</td></tr></tbody></table> <p>Note that top level filters is wrapped in an implicit <code>and</code>.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="order_by-">order_by <span style="color:#718096;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">optional</span><a href="#order_by-" class="hash-link" aria-label="Direct link to order_by-" title="Direct link to order_by-"></a></h3> <p>Allows for custom ordering of query results.</p> <p>List of tuples <code>[dimension_or_metric, direction]</code>, where:</p> <ul> <li><code>dimension_or_metric</code> needs to be listed in query <a href="#metrics"><code>metrics</code></a> or <a href="#dimensions"><code>dimensions</code></a> respectively.</li> <li><code>direction</code> can be one of <code>"asc"</code> or <code>"desc"</code></li> </ul> <p>For example:</p> <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visitors"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"desc"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visit:country_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"asc"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <p>When not specified, the default ordering is:</p> <ol> <li>If a <a href="#time-dimensions">time dimensions</a> is present, <code>[time_dimension, "asc"]</code></li> <li>By the first metric specified, descending.</li> </ol> <p><a href="#example-custom-properties">See full query example</a></p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="include-">include <span style="color:#718096;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">optional</span><a href="#include-" class="hash-link" aria-label="Direct link to include-" title="Direct link to include-"></a></h3> <p>Default: <code>{}</code></p> <p>Additional options for the query as to what data to include.</p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="include.imports">include.imports<a href="#include.imports" class="hash-link" aria-label="Direct link to include.imports" title="Direct link to include.imports"></a></h4> <p>Default: <code>false</code></p> <p>If true, tries to include imported data in the result. See <a href="#imported-stats">imported stats</a> for more details, <a href="#example-imports">query example</a>.</p> <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Read more on limitations of including imported data</summary><div><div class="collapsibleContent_i85q"><p>Using custom property dimensions (<code>event:props:*</code>) are only supported for 2 properties: <code>url</code> and <code>path</code>. Additionally, these breakdowns will only work in combination with a <a href="/docs/csv-import#goals-and-custom-properties">certain subset</a> of <code>event:goal</code> filters.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="filtering-imported-stats">Filtering imported stats<a href="#filtering-imported-stats" class="hash-link" aria-label="Direct link to Filtering imported stats" title="Direct link to Filtering imported stats"></a></h5><p>Filtering by imported data is limited. The general rule is that you cannot filter by two different properties at the same time. For example, <code>event:page==/;visit:source==Twitter</code> is not able to return any imported results. The same happens when you try to filter by one dimension and set another as a dimension.</p><p>There are some exceptions though. The following dimensions are aggregated and grouped together and can be combined in a query:</p><ul> <li>Countries, regions, cities</li> <li>Operating systems and their versions</li> <li>Hostnames and pages</li> <li>Specific custom events and their properties<!-- --> <ul> <li><code>Outbound Link: Click</code> and <code>File Download</code> goals with the <code>url</code> property</li> <li><code>404</code> goals with the <code>path</code> property</li> </ul> </li> </ul><p>For example, you can set a <code>country</code> dimension and filter by both <code>city</code> and <code>region</code>.</p></div></div></details> <p>If set, <code>meta.imports_included</code> field will be set as a boolean.</p> <p>If the applied combination of filters and dimensions is not supported for imported stats, the results are still returned based only on native stats. Additionally, <code>meta.imports_skip_reason</code> and <code>meta.imports_warning</code> response fields will contain more information on why including imported data failed. <a href="#example-imports-warning">See example</a></p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="include.time_labels">include.time_labels<a href="#include.time_labels" class="hash-link" aria-label="Direct link to include.time_labels" title="Direct link to include.time_labels"></a></h4> <p>Default: <code>false</code></p> <p>Requires a <code>time</code> dimension being set. If true, sets <code>meta.time_labels</code> in response containing all time labels valid for <code>date_range</code>.</p> <p><a href="#example-time-labels">See example</a></p> <h4 class="anchor anchorWithStickyNavbar_LWe7" id="include.total_rows">include.total_rows<a href="#include.total_rows" class="hash-link" aria-label="Direct link to include.total_rows" title="Direct link to include.total_rows"></a></h4> <p>Default: <code>false</code></p> <p>Should be used for <a href="#pagination">pagination</a>. If true, sets <code>meta.total_rows</code> in response containing the total number of rows for this query.</p> <p><a href="#example-pagination">See example</a></p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="pagination-">pagination <span style="color:#718096;font-size:0.7rem;font-weight:bold;position:relative;bottom:4px">optional</span><a href="#pagination-" class="hash-link" aria-label="Direct link to pagination-" title="Direct link to pagination-"></a></h3> <p>Default: <code>{ "limit": 10000, "offset: 0 }</code></p> <p><a href="#example-pagination">See example</a></p> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="response-structure">Response structure<a href="#response-structure" class="hash-link" aria-label="Direct link to Response structure" title="Direct link to Response structure"></a></h2> <p>Example response:</p> <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"results"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">99</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">98</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">94</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"Estonia"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"Tallinn"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">98</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">82</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">97</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"Brazil"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"São Paulo"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">97</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">77</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">98</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"Germany"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"Berlin"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">94</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">86</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">93</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"Italy"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"Rome"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">89</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">77</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">96</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"United States"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"San Francisco"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token number" style="color:rgb(247, 140, 108)">82</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">78</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">92</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"Poland"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"Warsaw"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"meta"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"query"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"site_id"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"dummy.site"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"metrics"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visitors"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"pageviews"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"bounce_rate"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"date_range"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"2024-09-04T00:00:00+00:00"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"2024-09-10T23:59:59+00:00"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"filters"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"is_not"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"visit:country_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">""</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"dimensions"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visit:country_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"visit:city_name"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"order_by"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token punctuation" style="color:rgb(199, 146, 234)">[</span><span class="token string" style="color:rgb(195, 232, 141)">"visitors"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">"desc"</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">]</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"include"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="results">results<a href="#results" class="hash-link" aria-label="Direct link to results" title="Direct link to results"></a></h3> <p>Results is an ordered list query results.</p> <p>Each result row contains:</p> <ul> <li><code>dimensions</code> - values for each <code>dimension</code> listed in query. In the same order as query <code>dimensions</code>, empty if no dimensions requested.</li> <li><code>metrics</code> - List of metric values, in the same order as query <code>metrics</code></li> </ul> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="meta">meta<a href="#meta" class="hash-link" aria-label="Direct link to meta" title="Direct link to meta"></a></h3> <p>Meta information about this query. Related: <a href="#include.imports">include.imports</a> and <a href="#include.time_labels">include.time_labels</a>.</p> <h3 class="anchor anchorWithStickyNavbar_LWe7" id="query">query<a href="#query" class="hash-link" aria-label="Direct link to query" title="Direct link to query"></a></h3> <p>The query that was executed, after manipulations performed on the backend.</p> <h2 class="anchor anchorWithStickyNavbar_LWe7" id="examples">Examples<a href="#examples" class="hash-link" aria-label="Direct link to Examples" title="Direct link to Examples"></a></h2> </div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/plausible/docs/edit/master/docs/stats-api.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_JAkA"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/carrd-integration"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Adding Plausible to Carrd (and tracking custom events)</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/stats-api-playground"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Playground</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#authentication" class="table-of-contents__link toc-highlight">Authentication</a><ul><li><a href="#example-curl-request" class="table-of-contents__link toc-highlight">Example curl request</a></li></ul></li><li><a href="#request-structure" class="table-of-contents__link toc-highlight">Request structure</a><ul><li><a href="#site_id-" class="table-of-contents__link toc-highlight">site_id <required></required></a></li><li><a href="#date_range" class="table-of-contents__link toc-highlight">date_range <required></required></a></li><li><a href="#metrics" class="table-of-contents__link toc-highlight">metrics <required></required></a></li><li><a href="#dimensions" class="table-of-contents__link toc-highlight">dimensions <optional></optional></a><ul><li><a href="#event-dimensions" class="table-of-contents__link toc-highlight">Event dimensions</a></li><li><a href="#visit-dimensions" class="table-of-contents__link toc-highlight">Visit dimensions</a></li><li><a href="#time-dimensions" class="table-of-contents__link toc-highlight">Time dimensions</a></li><li><a href="#custom-properties" class="table-of-contents__link toc-highlight">Custom properties</a></li></ul></li><li><a href="#filters-" class="table-of-contents__link toc-highlight">filters <optional></optional></a><ul><li><a href="#simple-filters" class="table-of-contents__link toc-highlight">Simple filters</a></li><li><a href="#logical-operations" class="table-of-contents__link toc-highlight">Logical operations</a></li></ul></li><li><a href="#order_by-" class="table-of-contents__link toc-highlight">order_by <optional></optional></a></li><li><a href="#include-" class="table-of-contents__link toc-highlight">include <optional></optional></a><ul><li><a href="#include.imports" class="table-of-contents__link toc-highlight">include.imports</a></li><li><a href="#include.time_labels" class="table-of-contents__link toc-highlight">include.time_labels</a></li><li><a href="#include.total_rows" class="table-of-contents__link toc-highlight">include.total_rows</a></li></ul></li><li><a href="#pagination-" class="table-of-contents__link toc-highlight">pagination <optional></optional></a></li></ul></li><li><a href="#response-structure" class="table-of-contents__link toc-highlight">Response structure</a><ul><li><a href="#results" class="table-of-contents__link toc-highlight">results</a></li><li><a href="#meta" class="table-of-contents__link toc-highlight">meta</a></li><li><a href="#query" class="table-of-contents__link toc-highlight">query</a></li></ul></li><li><a href="#examples" class="table-of-contents__link toc-highlight">Examples</a><ul><li><a href="#example-aggregate" class="table-of-contents__link toc-highlight">Simple aggregate query</a></li><li><a href="#example-custom-date-range" class="table-of-contents__link toc-highlight">Custom date range</a></li><li><a href="#example-country-and-city" class="table-of-contents__link toc-highlight">Country and city analysis</a></li><li><a href="#example-utm" class="table-of-contents__link toc-highlight">UTM medium, source analysis</a></li><li><a href="#example-filtering" class="table-of-contents__link toc-highlight">Filtering by page and country</a></li><li><a href="#example-timeseries" class="table-of-contents__link toc-highlight">Timeseries query</a></li><li><a href="#example-time-labels" class="table-of-contents__link toc-highlight">Timeseries query hourly, with labels</a></li><li><a href="#example-custom-properties" class="table-of-contents__link toc-highlight">Using custom properties</a></li><li><a href="#example-pagination" class="table-of-contents__link toc-highlight">Pagination</a></li><li><a href="#example-imports" class="table-of-contents__link toc-highlight">Including imported data</a></li><li><a href="#example-imports-warning" class="table-of-contents__link toc-highlight">Including imported data failed</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Study</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://plausible.io/about" target="_blank" rel="noopener noreferrer" class="footer__link-item">About Plausible</a></li><li class="footer__item"><a href="https://plausible.io/blog" target="_blank" rel="noopener noreferrer" class="footer__link-item">Read our blog</a></li><li class="footer__item"><a href="https://plausible.io/docs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Study the documentation</a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/plausible/" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://twitter.com/plausiblehq" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://fosstodon.org/@plausible" target="_blank" rel="noopener noreferrer" class="footer__link-item">Mastodon<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://www.linkedin.com/company/plausible-analytics/" target="_blank" rel="noopener noreferrer" class="footer__link-item">LinkedIn<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">Explore</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://plausible.io/feedback" target="_blank" rel="noopener noreferrer" class="footer__link-item">Give us feedback<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://plausible.io/roadmap" target="_blank" rel="noopener noreferrer" class="footer__link-item">We have a public roadmap</a></li><li class="footer__item"><a href="https://plausible.io/plausible.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">Check out the live demo<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://plausible.io/status" target="_blank" rel="noopener noreferrer" class="footer__link-item">Status<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2024 Plausible Analytics. Built with Docusaurus.</div></div></div></footer></div> </body> </html>