<style> .dynamic-page > div > div.block > div { margin: 0; } .joliframe { display: block; } @media(max-width:1000px){ \#content iframe.joliframe { height: 2200px !important; } } @media(min-width:1001px){ \#content iframe.joliframe { height: 1800px !important; } } </style> <script> (function () { 'use strict'; const IFRAME_SELECTOR = 'iframe.joliframe'; const ALLOWED_CONTINUE_PREFIX = 'https://creatorapp.zohopublic.com/fitnessfirstme/fitness-first/page-embed/'; function getQueryParam(name) { try { return new URLSearchParams(window.location.search).get(name); } catch { return null; } } function getGACookie() { try { const m = document.cookie.match(/_ga=GA\d+\.\d+\.(\d+\.\d+)/); return m ? m[1] : null; } catch { return null; } } // Normalize URLs that contain multiple '?' function normalizeUrl(url) { const parts = url.split('?'); if (parts.length <= 2) return url; return parts.shift() + '?' + parts.join('&'); } function collectAllParams() { const params = { // UTMs utm_source: getQueryParam('utm_source'), utm_medium: getQueryParam('utm_medium'), utm_campaign: getQueryParam('utm_campaign'), utm_id: getQueryParam('utm_id'), // Campaign campaign_id: getQueryParam('campaign_id'), // Click IDs gclid: getQueryParam('gclid'), fbclid: getQueryParam('fbclid'), sccid: getQueryParam('ScCid'), ttclid: getQueryParam('ttclid'), // GA ga_cid: getGACookie() }; Object.keys(params).forEach(k => { if (!params[k]) delete params[k]; }); return params; } function getContinueUrl() { const url = window.location.href; const key = "continue="; const index = url.indexOf(key); if (index === -1) return null; // Grab everything after "continue=" to the end of the URL const cont = url.substring(index + key.length); try { // Decode just in case const decoded = decodeURIComponent(cont); // Security: only allow iframe URLs with correct prefix if (decoded.startsWith(ALLOWED_CONTINUE_PREFIX)) { const normalized = normalizeUrl(decoded); // --- Clean the browser URL to /join --- const joinIndex = url.indexOf("/join"); if (joinIndex !== -1 && history && history.replaceState) { const cleanUrl = url.substring(0, joinIndex + 5); // keep "/join" history.replaceState(null, "", cleanUrl); } return normalized; } } catch (e) { console.error("Continue URL processing failed:", e); return null; } return null; } function injectOnce() { const iframe = document.querySelector(IFRAME_SELECTOR); if (!iframe || iframe.dataset.injected === 'true') return; try { //Base iframe URL let baseSrc = iframe.src; //Override with continue= if present const continueUrl = getContinueUrl(); if (continueUrl) { baseSrc = continueUrl; } //Normalize BEFORE parsing const iframeUrl = new URL(normalizeUrl(baseSrc)); // Append tracking params safely const params = collectAllParams(); Object.entries(params).forEach(([key, value]) => { if (!iframeUrl.searchParams.has(key)) { iframeUrl.searchParams.append(key, value); } }); //Apply once iframe.src = iframeUrl.toString(); iframe.dataset.injected = 'true'; } catch (e) { console.error('Iframe URL processing failed:', e); } } window.addEventListener('load', injectOnce); })(); </script>