Player Privacy Mode
Enable or disable Privacy Mode for individual visitors using the Player API
Our video player has a special mode called Privacy Mode that only collects fully anonymized viewing data by disabling session and cookie tracking and anonymizing IP addresses. You can change whether this mode is enabled by default for your account in your account settings. This mode makes sure Wistia video viewing is compatible with GDPR regulations. If you want to learn more about Wistia and GDPR, refer to our documentation on that.
When Privacy Mode is enabled, you may have a way for visitors to opt in to being tracked. When that happens, you can use the Player API to enable non-anonymous tracking for those specific viewers.
NotePrivacy Mode does not currently apply to Live events in the same way it does for video and channel views. If Privacy Mode is enabled, we still collect identifiable event data when using a Wistia registration form.
If your organization requires strict privacy controls, there are two options for using Live events with minimal data collection:
- Use a Marketing Automation Platform (MAP) form : Wistia does not store registration data. Only registration information is passed back to your MAPāno attendance or engagement data is tracked or shared.
- Turn off registration entirely: No personal information is collected when registration is off. Wistia only provides anonymous, aggregate analytics when Privacy Mode is enabled.
Using the API
The W.consent() methods below are available as soon as Wistia's player script is on the page:
- Aurora player (
player.js): the consent API is included automatically. Any page with an Aurora embedāthe<wistia-player>web component or the Aurora<script src="https://fast.wistia.com/player.js">ācan callW.consent()without any additional script. - Legacy player (E-v1.js): on pages that still use the legacy player, Wistia's embedding script,
https://fast.wistia.com/assets/external/E-v1.jsorhttps://fast.wistia.net/assets/external/E-v1.js, must be present for these methods to run.
Enable tracking for a single visitor
To enable tracking of a specific visitor, you can mark that they consent to being tracked:
window._wq = window._wq || [];
window._wq.push(function (W) {
W.consent(true);
});This setting is persisted in localStorage, so you don't need to call this on every page load.
Disable tracking for a single visitor
If a visitor decides that they would like to be anonymous, you can put them into Privacy Mode, whatever your account settings may be:
window._wq = window._wq || [];
window._wq.push(function (W) {
W.consent(false);
});Calling W.consent(false) will remove any temporary storage used for tracking purposes. Some cookies and localStorage that are used for non-tracking functionality may remain.
Check whether a visitor is in Privacy Mode
To see if a visitor is in privacy mode:
window._wq = window._wq || [];
window._wq.push(function (w) {
console.log("Viewer consent to tracking?", W.consent()); // returns true or false
});Return a single visitor's preference to the account default
If you would like to defer a visitor's consent to your account default, you can do the following:
window._wq = window._wq || [];
window._wq.push(function (W) {
W.consent('default');
});Listen for consent changes on the Aurora player
When you change a visitor's consent with W.consent(true), W.consent(false), or W.consent('default'), the Aurora player dispatches a visitor-tracking-change CustomEvent to every <wistia-player> element on the page. This lets you react to a consent change per playerāfor example, to update your own UI when a visitor opts in or out.
The event's detail.isTrackingEnabled reflects the value passed to W.consent():
document.querySelectorAll("wistia-player").forEach(function (player) {
player.addEventListener("visitor-tracking-change", function (event) {
console.log("Tracking enabled for this player?", event.detail.isTrackingEnabled);
});
});Notes
If videos for multiple accounts are on the same page and have different Privacy Mode settings, then Privacy Mode is considered ON. That is, when in doubt, we will not track the viewer.
Videos in iframes can receive consent using the browser's postMessage() feature. However, if the video's iframe is separated from the parent page by an intermediary iframe, it cannot communicate, and W.consent(true) or W.consent(false) will have no effect on it in that case.
IE8 and below--and IE11 when in IE8 compatibility mode--do not currently support Player Privacy Mode.
Updated 6 days ago