The TripAdvisor Widget consists of two cookie-setting elements:
1. An image
2. A script
To prevent each element from setting cookies prior to the users consent, we have to mark up the elements.
Below, the img tag is marked up with the data-src attribute, rather than src.
The script tag gets the TripAdvisor javascript, and waits until it is loaded, before rendering it.
Normally it is sufficient to mark up a script tag with <script type="text/javascript" data-cookieconsent="marketing">
, however, in the case with TripAdvisor, it won't work, because TripAdvisor is executed after the site has loaded (window.onload) - the problem is, that Cookiebot executes after the event, which means we need to use a callback (waitForTripAdvisor function).
We have placed additional <div> placeholders, to give the users ability to change their consent, in order to view the Widget. You can style this however you like.
Comments
0 comments
Please sign in to leave a comment.