// ═══════════════════════════════════════════════
// CHALETS SÉQUOIA DURBUY — JavaScript personnalisé
// ═══════════════════════════════════════════════
// 1. CACHER LA STICKY BAR SUR LES PAGES RÉSERVATION
(function() {
var path = window.location.pathname;
var hideOnPages = ['/reservation', '/booking'];
var shouldHide = hideOnPages.some(function(p) {
return path.indexOf(p) !== -1;
});
if (shouldHide) {
var bar = document.getElementById('sequoia-sticky-bar');
if (bar) bar.style.display = 'none';
}
})();
// 2. TRACKING GA4 — CLICS WHATSAPP
// Envoie un événement dans GA4 à chaque clic sur un lien WhatsApp
document.addEventListener('click', function(e) {
var el = e.target.closest('a');
if (!el) return;
var href = el.href || '';
if (href.indexOf('wa.me') !== -1 || href.indexOf('whatsapp') !== -1) {
// Détecter le contexte du clic
var label = 'WhatsApp général';
if (href.indexOf('138') !== -1) label = 'WhatsApp Séquoia 138';
else if (href.indexOf('140') !== -1) label = 'WhatsApp Séquoia 140';
else if (href.indexOf('Duo') !== -1 || href.indexOf('duo') !== -1) label = 'WhatsApp Séquoia Duo';
else if (href.indexOf('question') !== -1) label = 'WhatsApp FAQ';
if (typeof gtag === 'function') {
gtag('event', 'whatsapp_click', {
'event_category': 'Contact',
'event_label': label,
'page_path': window.location.pathname
});
}
// Compatible GTM dataLayer aussi
if (window.dataLayer) {
window.dataLayer.push({
'event': 'whatsapp_click',
'click_label': label,
'page_path': window.location.pathname
});
}
}
});
// 3. TRACKING GA4 — CLICS DISPONIBILITÉS
document.addEventListener('click', function(e) {
var el = e.target.closest('a');
if (!el) return;
var href = el.href || '';
var text = el.textContent.trim().toLowerCase();
if (
href.indexOf('disponibilit') !== -1 ||
href.indexOf('tarifs') !== -1 ||
href.indexOf('prijzen') !== -1 ||
text.indexOf('disponib') !== -1 ||
text.indexOf('beschikbaar') !== -1
) {
if (typeof gtag === 'function') {
gtag('event', 'disponibilites_click', {
'event_category': 'Navigation',
'event_label': 'Voir disponibilités',
'page_path': window.location.pathname
});
}
if (window.dataLayer) {
window.dataLayer.push({
'event': 'disponibilites_click',
'page_path': window.location.pathname
});
}
}
});
// 4. POPUP DE SORTIE — WhatsApp
// Apparaît une seule fois quand la souris quitte la fenêtre vers le haut
(function() {
var shown = false;
// Ne pas afficher sur mobile (pas de mouvement souris) ni sur pages réservation
var isMobile = /Mobi|Android/i.test(navigator.userAgent);
var isBookingPage = window.location.pathname.indexOf('reservation') !== -1 ||
window.location.pathname.indexOf('booking') !== -1;
if (isMobile || isBookingPage) return;
// Ne pas afficher si déjà montré dans cette session
if (sessionStorage.getItem('exitPopupShown')) return;
document.addEventListener('mouseleave', function(e) {
if (e.clientY > 20 || shown) return;
shown = true;
sessionStorage.setItem('exitPopupShown', '1');
// Créer le popup
var overlay = document.createElement('div');
overlay.id = 'sequoia-exit-popup';
overlay.style.cssText = [
'position:fixed', 'inset:0', 'z-index:9999',
'background:rgba(42,34,24,0.75)',
'display:flex', 'align-items:center', 'justify-content:center',
'padding:1.5rem', 'animation:fadeIn 0.3s ease'
].join(';');
overlay.innerHTML = [
'',
''
].join('');
document.body.appendChild(overlay);
// Fermeture
document.getElementById('sequoia-popup-close').addEventListener('click', function() {
overlay.remove();
});
overlay.addEventListener('click', function(e) {
if (e.target === overlay) overlay.remove();
});
// Tracking GA4
if (typeof gtag === 'function') {
gtag('event', 'exit_popup_shown', {'event_category': 'Engagement'});
}
});
})();
Résumé de la réservation
Informations de contact
Veuillez indiquer votre adresse email.
Assurez-vous que tous les champs de contact sont remplis.
Informations de paiement
Politique d'annulation
- 100% des règlements pré-payés sont remboursables en cas d'annulation 14 jour(s) avant l'arrivée ou plus tôt.
- 50% des règlements pré-payés sont remboursables en cas d'annulation 7 jour(s) avant l'arrivée ou plus tôt.
- 0% remboursable si annulation après.
Politique relative à la caution
Aucune caution n'est due.
Résumé de la réservation
Informations de contact
Veuillez indiquer votre adresse email.
Assurez-vous que tous les champs de contact sont remplis.