Consent Management

The Viafoura consent management script is used to track if a user has consented for their current session to be shared.

This document attempts to outline how to integrate with a Consent Management Platform (CMP) so that your users can still use Viafoura's products without being tracked in accordance to GDPR, CCPA, and other privacy legislation.

This feature is meant for sites where a CMP integration exists or is planned. With the inclusion of our Viafoura Tracking Consent script, you can configure your CMP such that our experiences will not track a given session.

How it works

In order to allow your users to be able to do things like edit comments even if they don't consent to being tracked, you will need to load a second piece of JavaScript on your site as early as possible, in accordance with your CMP's guidelines. For example, some CMPs insist on being the first thing loaded in the head, and that any scripts you want blocked to be loaded directly afterwards.

This second piece of JavaScript is called vftc - Viafoura Tracking Consent. This is a tiny piece of JS that you need to include on every page. When the script is not blocked by the CMP, then it will set a flag on sessionStorage called __vftc__. The rest of our JavaScript will be looking for this flag, and when it does not find it, then it will not track the user.

Step 1: Load the Viafoura Tracking Consent JavaScript file

Add the Tracking Consent script to the head of each of your pages before loading any other Viafoura scripts.

The script's URL is https://cdn.viafoura.net/vftc/index.js .

<!DOCTYPE html>
<html>
<head>
...
<script type="text/javascript" src="https://cdn.viafoura.net/vftc/index.js"></script>
</head>
</html>

This script needs to be in the head and not the body, so that your CMP can block it before it executes.

Step 2: Add Viafoura script to your Consent Management Platform (CMP)

In your CMP you will need to ensure that vftc.js is picked up and configured to be blocked when the user does not consent to being tracked. The steps to do this will be dependent on the CMP you are using.

Step 3: Add viafoura's scripts as normal

If you are using the CDN entry point or vf-v2.js, nothing changes here. You want to continue loading that script as normal.

How do I know that the script is working?

If the script is running and consent has been given to track, you will see a local storage value of "__vftc__": true. If there is no local storage value that means that our script has been blocked by your CMP. You can see that by looking at the markup where our script is and see if a type=javascript/blocked has been added to it.