Handling Consent ​
The recommended integrations use the parent website's existing analytics and consent setup for forwarding events, and should not require separate handling of users' cookie consents.
Forwarding Consent to Videobot ​
Note
This section is relevant for Videobots with a legacy GA4 integration, which sends events directly from the Videobot.
In order to use Google Analytics within your Videobot instance, you need to install it in a way that passes the consent data from your consent management platform (CMP) to the Videobot.
Consent Options ​
The following options can be controlled for expressing user consent:
Name | Example usage |
---|---|
ad_storage | Remarketing |
analytics_storage | Analytics |
functionality_storage | Required cookies |
personalization_storage | Remember dark mode |
security_storage | Login cookies |
Each of these options can have either the value denied
or granted
.
Available Methods ​
There are a few different options for passing consent to the Videobot embedded into your website, and each of them have their own pros and cons.
Data Attributes ​
The simplest way to define consent options is with data attributes. These can be set in the Videobot container element, and they are read when the script loads.
Attribute | Values |
---|---|
data-ad-storage | denied / granted |
data-analytics-storage | denied / granted |
data-functionality-storage | denied / granted |
data-personalization-storage | denied / granted |
data-security-storage | denied / granted |
This method is a good option when the Videobot script is injected after the user has defined their consent.
Changing Values
Setting these dynamically will not have an effect after the Videobot has initialized. In that case you must call the Videobot.refresh()
method from the JavaScript API.
Example ​
<div
id="videobot"
data-videobot-id="NYswCVZ9"
data-ad-storage="denied"
data-analytics-storage="granted"
data-functionality-storage="granted"
data-personalization-storage="denied"
data-security-storage="granted"
></div>
<script type="module" src="https://videobot.com/embed/videobot.mjs"></script>
In the above example, static consent values have been defined for the Videobot. The actual values for these options should be defined by your CMP, and should reflect the user's selection.
JavaScript API ​
The above example is straightforward, but has limited support for users changing their preferences. It also makes it hard to show the Videobot for users who have not defined their consent, or block your analytics code from running.
A more flexible way of defining consent is using the public JavaScript API for the Videobot widget.
Example ​
<script type="module">
import { Videobot } from 'https://videobot.com/embed/videobot.mjs'
Videobot.setGoogleConsent({
ad_storage: 'denied',
analytics_storage: 'granted',
functionality_storage: 'granted',
personalization_storage: 'denied',
security_storage: 'granted',
})
</script>