analytics/PlausibleWeb.Api.StatsController.html

1192 lines
42 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.31.1">
<meta name="project" content="Plausible v0.0.1">
<title>PlausibleWeb.Api.StatsController — Plausible v0.0.1</title>
<link rel="stylesheet" href="dist/html-elixir-FM2CSD74.css" />
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
<script src="dist/sidebar_items-C2C3DA6A.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/html-L4O5OK2K.js"></script>
</head>
<body data-type="modules" class="page-module">
<script>
try {
var settings = JSON.parse(localStorage.getItem('ex_doc:settings') || '{}');
if (settings.theme === 'dark' ||
((settings.theme === 'system' || settings.theme == null) &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.body.classList.add('dark')
}
} catch (error) { }
</script>
<div class="main">
<button id="sidebar-menu" class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
</button>
<div class="background-layer"></div>
<nav id="sidebar" class="sidebar">
<div class="sidebar-header">
<div class="sidebar-projectInfo">
<a href="readme.html" class="sidebar-projectImage">
<img src="assets/logo.png" alt="Plausible" />
</a>
<div>
<a href="readme.html" class="sidebar-projectName" translate="no">
Plausible
</a>
<div class="sidebar-projectVersion" translate="no">
v0.0.1
</div>
</div>
</div>
<ul id="sidebar-listNav" class="sidebar-listNav" role="tablist">
<li>
<button id="extras-list-tab-button" role="tab" data-type="extras" aria-controls="extras-tab-panel" aria-selected="true" tabindex="0">
Pages
</button>
</li>
<li>
<button id="modules-list-tab-button" role="tab" data-type="modules" aria-controls="modules-tab-panel" aria-selected="false" tabindex="-1">
Modules
</button>
</li>
<li>
<button id="tasks-list-tab-button" role="tab" data-type="tasks" aria-controls="tasks-tab-panel" aria-selected="false" tabindex="-1">
<span translate="no">Mix</span> Tasks
</button>
</li>
</ul>
</div>
<div id="extras-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="extras-list-tab-button">
<ul id="extras-full-list" class="full-list"></ul>
</div>
<div id="modules-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="modules-list-tab-button" hidden>
<ul id="modules-full-list" class="full-list"></ul>
</div>
<div id="tasks-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="tasks-list-tab-button" hidden>
<ul id="tasks-full-list" class="full-list"></ul>
</div>
</nav>
<main class="content">
<output role="status" id="toast"></output>
<div class="content-outer">
<div id="content" class="content-inner">
<div class="top-search">
<div class="search-settings">
<form class="search-bar" action="search.html">
<label class="search-label">
<span class="sr-only">Search documentation of Plausible</span>
<input name="q" type="text" class="search-input" placeholder="Search Documentation (press /)" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</label>
<button type="submit" class="search-button" aria-label="Submit Search">
<i class="ri-search-2-line ri-lg" aria-hidden="true" title="Submit search"></i>
</button>
<button type="button" tabindex="-1" class="search-close-button" aria-hidden="true">
<i class="ri-close-line ri-lg" title="Cancel search"></i>
</button>
</form>
<div class="autocomplete">
</div>
<button class="icon-settings display-settings">
<i class="ri-settings-3-line"></i>
<span class="sr-only">Settings</span>
</button>
</div>
</div>
<h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1" title="View Source" class="icon-action" rel="help">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
<span translate="no">PlausibleWeb.Api.StatsController</span>
<small class="app-vsn" translate="no">(Plausible v0.0.1)</small>
</h1>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Summary</span>
</h1>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#all_custom_prop_values/2" translate="no">all_custom_prop_values(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#browser_versions/2" translate="no">browser_versions(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#browsers/2" translate="no">browsers(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#build_intervals/4" translate="no">build_intervals(labels, date_range, start_fn, end_fn)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#cities/2" translate="no">cities(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#conversions/2" translate="no">conversions(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#countries/2" translate="no">countries(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#current_visitors/2" translate="no">current_visitors(conn, _)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#custom_prop_values/2" translate="no">custom_prop_values(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#entry_pages/2" translate="no">entry_pages(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#exit_pages/2" translate="no">exit_pages(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#filter_suggestions/2" translate="no">filter_suggestions(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#format_money/1" translate="no">format_money(money)</a>
</div>
<div class="summary-synopsis"><p>See <a href="PlausibleWeb.Controllers.API.Revenue.html#format_money/1"><code class="inline">PlausibleWeb.Controllers.API.Revenue.format_money/1</code></a>.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#format_revenue_metric/1" translate="no">format_revenue_metric(metric_value)</a>
</div>
<div class="summary-synopsis"><p>See <a href="PlausibleWeb.Controllers.API.Revenue.html#format_revenue_metric/1"><code class="inline">PlausibleWeb.Controllers.API.Revenue.format_revenue_metric/1</code></a>.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#funnel/2" translate="no">funnel(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#main_graph/2" translate="no">main_graph(conn, params)</a>
</div>
<div class="summary-synopsis"><p>Returns a time-series based on given parameters.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#operating_system_versions/2" translate="no">operating_system_versions(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#operating_systems/2" translate="no">operating_systems(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#pages/2" translate="no">pages(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#put_combined_name_with_version/2" translate="no">put_combined_name_with_version(row, name_key)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#referrer_drilldown/2" translate="no">referrer_drilldown(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#referrers/2" translate="no">referrers(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#regions/2" translate="no">regions(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#screen_sizes/2" translate="no">screen_sizes(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#sources/2" translate="no">sources(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#top_stats/2" translate="no">top_stats(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#utm_campaigns/2" translate="no">utm_campaigns(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#utm_contents/2" translate="no">utm_contents(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#utm_mediums/2" translate="no">utm_mediums(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#utm_sources/2" translate="no">utm_sources(conn, params)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#utm_terms/2" translate="no">utm_terms(conn, params)</a>
</div>
</div>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Functions</span>
</h1>
<div class="functions-list">
<section class="detail" id="all_custom_prop_values/2">
<div class="detail-header">
<a href="#all_custom_prop_values/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">all_custom_prop_values(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1322" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="browser_versions/2">
<div class="detail-header">
<a href="#browser_versions/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">browser_versions(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1125" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="browsers/2">
<div class="detail-header">
<a href="#browsers/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">browsers(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1094" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="build_intervals/4">
<div class="detail-header">
<a href="#build_intervals/4" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">build_intervals(labels, date_range, start_fn, end_fn)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L188" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="cities/2">
<div class="detail-header">
<a href="#cities/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">cities(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1051" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="conversions/2">
<div class="detail-header">
<a href="#conversions/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">conversions(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1267" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="countries/2">
<div class="detail-header">
<a href="#countries/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">countries(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L958" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="current_visitors/2">
<div class="detail-header">
<a href="#current_visitors/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">current_visitors(conn, _)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1381" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="custom_prop_values/2">
<div class="detail-header">
<a href="#custom_prop_values/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">custom_prop_values(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1306" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="entry_pages/2">
<div class="detail-header">
<a href="#entry_pages/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">entry_pages(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L859" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="exit_pages/2">
<div class="detail-header">
<a href="#exit_pages/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">exit_pages(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L893" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="filter_suggestions/2">
<div class="detail-header">
<a href="#filter_suggestions/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">filter_suggestions(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1388" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="format_money/1">
<div class="detail-header">
<a href="#format_money/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">format_money(money)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1559" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>See <a href="PlausibleWeb.Controllers.API.Revenue.html#format_money/1"><code class="inline">PlausibleWeb.Controllers.API.Revenue.format_money/1</code></a>.</p>
</section>
</section>
<section class="detail" id="format_revenue_metric/1">
<div class="detail-header">
<a href="#format_revenue_metric/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">format_revenue_metric(metric_value)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1558" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>See <a href="PlausibleWeb.Controllers.API.Revenue.html#format_revenue_metric/1"><code class="inline">PlausibleWeb.Controllers.API.Revenue.format_revenue_metric/1</code></a>.</p>
</section>
</section>
<section class="detail" id="funnel/2">
<div class="detail-header">
<a href="#funnel/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">funnel(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L533" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="main_graph/2">
<div class="detail-header">
<a href="#main_graph/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">main_graph(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L101" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Returns a time-series based on given parameters.</p><h2 id="main_graph/2-parameters" class="section-heading">
<a href="#main_graph/2-parameters" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Parameters</span>
</h2>
<p>This API accepts the following parameters:</p><ul><li><p><code class="inline">period</code> - x-axis of the graph, e.g. <code class="inline">12mo</code>, <code class="inline">day</code>, <code class="inline">custom</code>.</p></li><li><p><code class="inline">metric</code> - y-axis of the graph, e.g. <code class="inline">visits</code>, <code class="inline">visitors</code>, <code class="inline">pageviews</code>.
See the Stats API <a href="https://plausible.io/docs/stats-api#metrics">&quot;Metrics&quot;</a>
section for more details. Defaults to <code class="inline">visitors</code>.</p></li><li><p><code class="inline">interval</code> - granularity of the time-series data. You can think of it as
a <code class="inline">GROUP BY</code> clause. Possible values are <code class="inline">minute</code>, <code class="inline">hour</code>, <code class="inline">date</code>, <code class="inline">week</code>,
and <code class="inline">month</code>. The default depends on the <code class="inline">period</code> parameter. Check
<code class="inline">Plausible.Query.from/2</code> for each default.</p></li><li><p><code class="inline">filters</code> - optional filters to drill down data. See the Stats API
<a href="https://plausible.io/docs/stats-api#filtering">&quot;Filtering&quot;</a> section for
more details.</p></li><li><p><code class="inline">with_imported</code> - boolean indicating whether to include Google Analytics
imported data or not. Defaults to <code class="inline">false</code>.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="8628651020-1">%{</span><span class="w">
</span><span class="s">&quot;from&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;2021-09-06&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;interval&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;month&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;metric&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;visitors&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;period&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;custom&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;to&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;2021-12-13&quot;</span><span class="w">
</span><span class="p" data-group-id="8628651020-1">}</span></code></pre><h2 id="main_graph/2-response" class="section-heading">
<a href="#main_graph/2-response" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Response</span>
</h2>
<p>Returns a map with the following keys:</p><ul><li><p><code class="inline">plot</code> - list of values for the requested metric representing the y-axis
of the graph.</p></li><li><p><code class="inline">labels</code> - list of date times representing the x-axis of the graph.</p></li><li><p><code class="inline">present_index</code> - index of the element representing the current date in
<code class="inline">labels</code> and <code class="inline">plot</code> lists.</p></li><li><p><code class="inline">interval</code> - the interval used for querying.</p></li><li><p><code class="inline">includes_imported</code> - boolean indicating whether imported data
was queried or not.</p></li><li><p><code class="inline">imports_exist</code> - boolean indicating whether there are any completed
imports for a given site or not.</p></li><li><p><code class="inline">full_intervals</code> - map of dates indicating whether the interval has been
cut off by the requested date range or not. For example, if looking at a
month week-by-week, some weeks may be cut off by the month boundaries.
It's useful to adjust the graph display slightly in case the interval is
not 'full' so that the user understands why the numbers might be lower for
those partial periods.</p></li></ul><p>Full example:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="7584268048-1">%{</span><span class="w">
</span><span class="s">&quot;full_intervals&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="7584268048-2">%{</span><span class="w">
</span><span class="s">&quot;2021-09-01&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;2021-10-01&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;2021-11-01&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;2021-12-01&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">false</span><span class="w">
</span><span class="p" data-group-id="7584268048-2">}</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;imports_exist&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;interval&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;month&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;labels&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="7584268048-3">[</span><span class="s">&quot;2021-09-01&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;2021-10-01&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;2021-11-01&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;2021-12-01&quot;</span><span class="p" data-group-id="7584268048-3">]</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;plot&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="7584268048-4">[</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="7584268048-4">]</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;present_index&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;includes_imported&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="no">false</span><span class="w">
</span><span class="p" data-group-id="7584268048-1">}</span></code></pre>
</section>
</section>
<section class="detail" id="operating_system_versions/2">
<div class="detail-header">
<a href="#operating_system_versions/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">operating_system_versions(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1196" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="operating_systems/2">
<div class="detail-header">
<a href="#operating_systems/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">operating_systems(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1165" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="pages/2">
<div class="detail-header">
<a href="#pages/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">pages(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L826" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="put_combined_name_with_version/2">
<div class="detail-header">
<a href="#put_combined_name_with_version/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">put_combined_name_with_version(row, name_key)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1574" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="referrer_drilldown/2">
<div class="detail-header">
<a href="#referrer_drilldown/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">referrer_drilldown(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L748" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="referrers/2">
<div class="detail-header">
<a href="#referrers/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">referrers(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L721" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="regions/2">
<div class="detail-header">
<a href="#regions/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">regions(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1013" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="screen_sizes/2">
<div class="detail-header">
<a href="#screen_sizes/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">screen_sizes(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L1236" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="sources/2">
<div class="detail-header">
<a href="#sources/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">sources(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L501" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="top_stats/2">
<div class="detail-header">
<a href="#top_stats/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">top_stats(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L206" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="utm_campaigns/2">
<div class="detail-header">
<a href="#utm_campaigns/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">utm_campaigns(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L613" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="utm_contents/2">
<div class="detail-header">
<a href="#utm_contents/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">utm_contents(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L640" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="utm_mediums/2">
<div class="detail-header">
<a href="#utm_mediums/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">utm_mediums(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L586" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="utm_sources/2">
<div class="detail-header">
<a href="#utm_sources/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">utm_sources(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L694" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="utm_terms/2">
<div class="detail-header">
<a href="#utm_terms/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">utm_terms(conn, params)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible_web/controllers/api/stats_controller.ex#L667" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
<button class="a-main footer-button display-quick-switch" title="Search HexDocs packages">
Search HexDocs
</button>
<a href="Plausible.epub" title="ePub version">
Download ePub version
</a>
</span>
</p>
<p class="built-using">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener" translate="no">ExDoc</a> (v0.31.1) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
</p>
</footer>
</div>
</div>
</main>
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad: true})</script>
</body>
</html>