vince v.11.3 has been released.

Concepts

Table of Contents

Each request requires a site_id parameter which is the domain of your site as configured in Vince. If you’re unsure, navigate to your site settings in Vince and grab the value of the domain field.

Metrics

You can specify a metrics option in the query, to choose the metrics for each instance returned. See here for a full overview of metrics and their definitions. The metrics currently supported in Stats API are:

MetricDescription
visitorsThe number of unique visitors.
visitsThe number of visits/sessions
pageviewsThe number of pageview events
views_per_visitThe number of pageviews divided by the number of visits. Returns a floating point number. Currently only supported in Aggregate and Timeseries endpoints.
bounce_rateBounce rate percentage
visit_durationVisit duration in seconds
eventsThe number of events (pageviews + custom events). When filtering by a goal, this metric corresponds to “Total Conversions” in the dashboard.
conversion_rateThe percentage of visitors who completed the goal. Requires an event:goal filter or event:goal property in the breakdown endpoint
time_on_pageThe average time users spend on viewing a single page. Requires an event:page filter or event:page property in the breakdown endpoint.

Time periods

The options are identical for each endpoint that supports configurable time periods. Each period is relative to a date parameter. The date should follow the standard ISO-8601 format. When not specified, the date field defaults to today(site.timezone). All time calculations on our backend are done in the time zone that the site is configured in.

  • 12mo,6mo - Last n calendar months relative to date.
  • month - The calendar month that date falls into.
  • 30d,7d - Last n days relative to date.
  • day - Stats for the full day specified in date.
  • custom - Provide a custom range in the date parameter.

When using a custom range, the date parameter expects two ISO-8601 formatted dates joined with a comma as follows ?period=custom&date=2021-01-01,2021-01-31. Stats will be returned for the whole date range inclusive of the start and end dates.

Properties

Each pageview and custom event in our database has some predefined properties associated with it. In other analytics tools, these are often referred to as dimensions as well. Properties can be used for filtering and breaking down your stats to drill into more depth. Here’s the full list of properties we collect automatically:

PropertyExampleDescription
event:goalRegisterA custom action that you want your users to take. To use this property, you first need to configure some goals in the site settings, or via the Sites API. The value is the goal’s display_name. Learn more about goals here.
event:page/blog/remove-google-analyticsPathname of the page where the event is triggered. You can also use an asterisk to group multiple pages (/blog*)
event:hostnameexample.comHostname of the event. At this stage, breaking down on hostname is not supported and you can only use this property for filtering. Use an asterisk to filter by multiple hostnames at once, e.g. *.example.com.
visit:entry_page/homePage on which the visit session started (landing page).
visit:exit_page/homePage on which the visit session ended (last page viewed).
visit:sourceTwitterVisit source, populated from an url query parameter tag (utm_source, source or ref) or the Referer HTTP header.
visit:referrert.co/fzWTE9OTPtRaw Referer header without http://, http:// or www..
visit:utm_mediumsocialRaw value of the utm_medium query param on the entry page.
visit:utm_sourcetwitterRaw value of the utm_source query param on the entry page.
visit:utm_campaignprofileRaw value of the utm_campaign query param on the entry page.
visit:utm_contentbannerRaw value of the utm_content query param on the entry page.
visit:utm_termkeywordRaw value of the utm_term query param on the entry page.
visit:deviceDesktopDevice type. Possible values are Desktop, Laptop, Tablet and Mobile.
visit:browserChromeName of the browser vendor. Most popular ones are Chrome, Safari and Firefox.
visit:browser_version88.0.4324.146Version number of the browser used by the visitor.
visit:osMacName of the operating system. Most popular ones are Mac, Windows, iOS and Android. Linux distributions are reported separately.
visit:os_version10.6Version number of the operating system used by the visitor.
visit:countryUSISO 3166-1 alpha-2 code of the visitor country.
visit:regionUS-MDISO 3166-2 code of the visitor region.
visit:city4347778GeoName ID of the visitor city.

Custom properties

In addition to properties that are collected automatically, you can also query for custom properties. To filter or break down by a custom property, use the key event:props:<custom_prop_name>. See example for how to use it.

Filtering

Most endpoints support a filters query parameter to drill down into your data. You can filter by all properties described in the Properties table, using the following operators:

OperatorUsage exampleExplanation
==event:goal==SignupSimple equality - completed goal “Signup”
!=visit:country!=FRSimple inequality - country is not France
|visit:source==Github|TwitterIN expression - visit source is Github or Twitter.
;event:goal==Signup;visit:country==DEAND expression - completed goal “Signup” and country is Germany
*event:page==/blog/*Wildcard - matches any character

:::tip Want to use the | character in a filter value? You can escape it with a backslash. For example, visit:utm_campaign==campaign\|one will let you filter by the literal campaign|one value :::

Limitations

  • It is currently possible to exclude only one value at a time (e.g. visit:browser!=Chrome|Safari is not yet supported)
  • Wildcard characters cannot be used in combination with an IN expression (except for pageview goals - e.g. event:goal==Signup|Visit+/register is supported)
  • Inequality != operator is currently not supported for goals
Tags :

Related Posts

Pebble and The One Billion Row Challenge with Roaring Bitmaps

We use Pebble Key Value Store and roaring bitmaps at the core of vince - A self hosted alternative to Google analytics. This blog post tackles The One Billion Row Challenge using pebble and roaring bitmaps.

Read More