Conditional Section
Personalization Content
This content is only visible when you've accepted Personalization cookies. Here you could place:
- Personalized recommendations
- Custom user interface elements
- Third-party personalization scripts
- User preference widgets
Enable Personalization in your Cookie Preferences to view this content.
Only show content when PERSONALIZATION is accepted
<!-- Conditional content (hidden unless Personalization is ACCEPT) -->
<div class="conditional-content" id="conditional-content" style="display:none;">
<h3>Personalization Content</h3>
<p>This content is only visible when you've accepted Personalization cookies. Here you could place:</p>
<ul>
<li>Personalized recommendations</li>
<li>Custom user interface elements</li>
<li>Third-party personalization scripts</li>
<li>User preference widgets</li>
</ul>
</div>
<div class="consent-required-message" id="consent-message">
<p>Enable Personalization in your <a href="javascript:void(0)" onclick="Osano.cm.showDrawer()">Cookie Preferences</a> to view this content.</p>
</div>
<script>
function updatePageBasedOnConsent(consent) {
if (!consent) return;
var content = document.getElementById('conditional-content');
var message = document.getElementById('consent-message');
if (consent.PERSONALIZATION === 'ACCEPT') {
content.style.display = 'block';
message.style.display = 'none';
} else {
content.style.display = 'none';
message.style.display = 'block';
}
}
document.addEventListener('DOMContentLoaded', function() {
if (typeof Osano !== 'undefined' && Osano.cm) {
Osano.cm.addEventListener('osano-cm-initialized', function(consent) {
updatePageBasedOnConsent(consent);
});
Osano.cm.addEventListener('osano-cm-consent-saved', function(consent) {
updatePageBasedOnConsent(consent);
});
}
});
</script>