Setting up

This 8Kb version tracks everyone without asking. Paste this code on your website's HTML source code to get things running:

<!-- Analytics by volument.com  -->
<script async src="https://cdn.volument.com/v1/volument.js"
  onload="volument('YOUR_TOKEN')"></script>

Learn more about privacy and consent banners here.

This 10Kb version displays a consent banner for European visitors. Here's the embed code:

<!-- Analytics by volument.com  -->
<script async src="https://cdn.volument.com/v1/volument-ui.js"
  onload="volument('YOUR_TOKEN')"></script>

Here's an embed code for a customized cookie banner:

<!-- Analytics by volument.com -->
<script async src="https://cdn.volument.com/v1/volument-ui.js"
  onload="volumentLoaded()"></script>

<script>
function volumentLoaded() {
  volument({
    token: 'YOUR_TOKEN',
    policy_url: '/privacy-policy',
    dnt: true,
    // etc..
  })
}
</script>

Here are all the available options:

token

The analytics token you receive after creating a new project. This is required.

dnt

Whether the navigator.doNotTrck- setting should disable tracking. Defaults to true.

policy_url

Link to the privacy policy. Default value: https://volument.com/privacy.

Name of the target window where the privacy policy document is opened. Leaving this empty opens it in the same window. Default value: “policy”

The content for countries, where opt-in is required. Any text inside brackets becomes a link to the privacy policy. Default value: “Allow [privacy-friendly analytics] to access your device?“

notice_text

The content for the European countries, where notice is enough. Any text inside brackets becomes a link to the privacy policy. Default value: “We use [privacy-friendly analytics] to improve the experience.“

no_text

The label of the “no” button in the consent dialog. Default value: “Not now”

yes_text

The label of the “yes” button in the consent dialog. Default value: “Yes”

ok_text

The label on the “OK” button on a notice dialog. Default value: “OK”

use_css

Whether the default CSS styling should be applied on the popup. Setting this to false allows you to style the dialog from scratch. Defaults to true.

Google Tag Manager

If you want to setup Volument with GTM, please create a Custom HTML tag with the following embed code:

<script src="https://cdn.volument.com/v1/volument.js"></script>
<script>window.volument && volument('YOUR_TOKEN')</script>

Set the Triggering to All pages.

Tracking conversions

Volument collects engagement and retention data automatically. However, all conversion events, like registrations and purchases, must be set up programmatically. This happens by calling the following JavaScript methods.

volument.convertToContact()

Call this method when the visitors join your mailing list and hand in their email address.

volument.convertToLead()

Call this method when the visitor becomes a sales lead by contacting sales and handing in their contact information.

volument.convertToUser()

Call this method when the visitor starts using your product.

volument.convertToCustomer()

Call this method when the visitor and converts to a customer by handing their payment information such as the credit card and no money is paid at the spot.

volument.convertToPromoter()

Call this method when the visitor converts to a promoter by inviting her friends or other associates to your product.

volument.pay(amountofcents)

Call this method when the visitor hands their payment information and pays the given amount of money. The value is provided in cents without decimals and in the currency of your choice.

The visitor is converted to a customer so no additional convertToCustomer call is needed.

volument.invite(peers)

Call this method when the visitor invites the given amount of peers to the site. The visitor is automatically converted to a promoter so no additional convertToPromoter call is needed.

Single-page applications

If your site is a single-page application (SPA) and the page change is built around pushState (PJAX, Turbolinks, or similar) you can use volument.route() to track page switches, for example:

// turbolinks example
document.addEventListener('turbolinks:load', function() {
  volument.route()
})

route([path])

Call this method when the visitor is routed to a new page. After this Volument starts tracking how the new page is consumed. The path argument is optional and location.pathname is used by default.

This website, for example, is a single-page application. Here's an article about it.

{"style":"/docs/syntax","desc":"How to enable Volument analytics for your website","title":"Setting up","url":"/how-it-works/setting-up","key":"setting-up","created":"2021-11-24T08:00:15.856Z","modified":"2022-05-02T06:10:14.569Z","createdISO":"2021-11-24","modifiedISO":"2022-05-02"}