Bereit, mit Podero zu steuern, zu handeln und zu skalieren?​

Bereit, mit Podero zu steuern, zu handeln und zu skalieren?​

Lassen Sie uns darüber sprechen, wie wir smartere Produkte ermöglichen.

document.addEventListener('DOMContentLoaded', function() { const popupId = 3494; // 🔹 замени на свой ID попапа // --- 1. Отслеживаем успешную отправку формы HubSpot window.addEventListener('message', function(event) { if (event.data && event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') { // Добавляем параметр ?thankyou=true без перезагрузки const url = new URL(window.location.href); url.searchParams.set('thankyou', 'true'); window.history.pushState({}, '', url.toString()); showThankyouPopup(); } }); // --- 2. Если страница открыта уже с ?thankyou=true (например, из аналитики) const params = new URLSearchParams(window.location.search); if (params.get('thankyou') === 'true') { showThankyouPopup(); } // --- 3. Функция показа попапа и очистки URL function showThankyouPopup() { if (typeof elementorProFrontend !== 'undefined' && elementorProFrontend.modules.popup) { elementorProFrontend.modules.popup.showPopup({ id: popupId }); // Событие в GA4 if (typeof gtag === 'function') { gtag('event', 'thankyou_popup_shown', { event_category: 'Form', event_label: window.location.pathname }); } // Событие в HubSpot if (window._hsq) { window._hsq.push([ 'trackEvent', { id: 'thankyou-popup', value: window.location.pathname } ]); } // Через 5 секунд закрываем попап и чистим URL setTimeout(function() { elementorProFrontend.modules.popup.closePopup({ id: popupId }); window.history.replaceState({}, document.title, window.location.pathname); }, 5000); } } });