How to Disable Cookie Usage
The Vidalytics player provides three methods to disable cookies:
1. Page-Level Disabling
You can disable cookies for the entire page by setting window._vidalytics.disableCookie to true.
When to use:
- If you don’t use cross-domain tracking and your funnel doesn’t involve subdomain jumps (e.g., from
example.comtobuy.example.com). - If you have multiple videos on a page and want to disable cookies for each of them.
Implementation:
2. Video-Level Disabling
To disable cookies on a per-video basis, modify your embed code as follows:
- Create a variable to hold the cookie settings:
{ tweak: { disableCookie: true } } - Pass this variable to the
run()method in the embed code. If the variable is namedvidalyticsCustomSettings, replacet.run(a)witht.run(a, vidalyticsCustomSettings).
Example:
3. Using the API Method
You can also control cookies programmatically using the window._vidalytics.tracking.setCookiePreference() method.
Key Features:
- This method can be called at any time.
- If set to
false, it removes any previously stored Vidalytics cookies. - The preference is stored in Local Storage for persistence.
- If called before the Vidalytics script loads, it retries execution automatically.
Implementation:
By choosing the appropriate method, you can effectively manage cookies based on your specific requirements.