Available Properties

Properties Found

S
Suri Sabri
Suri Sabri
Do you have questions?
Call or text today, we are here to help!
// ================================================================ // BROKERMIND AI - REMARKETING SYSTEM v1.0 // Complete visitor tracking + retargeting for real estate // ================================================================ (function() { 'use strict'; // ════════════════════════════════════════════════════════════════ // 1. CONFIGURATION // ════════════════════════════════════════════════════════════════ const CONFIG = { // Facebook Pixel ID (replace with yours) facebookPixelId: '123456789012345', // Google Analytics ID (replace with yours) googleAnalyticsId: 'G-XXXXXXXXXX', // LinkedIn Partner ID (replace with yours) linkedInPartnerId: '123456', // Pinterest Tag ID (replace with yours) pinterestTagId: '2612345678901', // TikTok Pixel ID (replace with yours) tiktokPixelId: 'CUSTOMER_PIXEL_ID', // Snapchat Pixel ID (replace with yours) snapchatPixelId: '12345678-1234-1234-1234-123456789012', // Google Ads Remarketing Tag (replace with yours) googleAdsId: 'AW-123456789', // Twitter/X Pixel ID (replace with yours) twitterPixelId: 'o4l5e', // Microsoft Advertising UET Tag (replace with yours) microsoftUetId: '123456789', // Criteo Partner ID (replace with yours) criteoPartnerId: '123456', // Taboola Pixel ID (replace with yours) taboolaPixelId: '1234567', // Outbrain Pixel ID (replace with yours) outbrainPixelId: '1234567890', // Reddit Pixel ID (replace with yours) redditPixelId: 't2_abc123', // Quora Pixel ID (replace with yours) quoraPixelId: '1234567890', // n8n webhook for custom tracking n8nWebhook: 'https://your-n8n.com/webhook/hammy-quintic-nexus/tools', // Enable/disable specific pixels enabled: { facebook: true, googleAnalytics: true, linkedIn: true, pinterest: true, tiktok: true, snapchat: true, googleAds: true, twitter: true, microsoft: true, criteo: true, taboola: true, outbrain: true, reddit: true, quora: true } }; // ════════════════════════════════════════════════════════════════ // 2. PIXEL LOADER ENGINE // ════════════════════════════════════════════════════════════════ function loadPixels() { // --- Facebook Pixel --- if (CONFIG.enabled.facebook && CONFIG.facebookPixelId) { !function(f,b,e,v,n,t,s) { if(f.fbq)return; n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n; n.push=n; n.loaded=!0; n.version='2.0'; n.queue=[]; t=b.createElement(e); t.async=!0; t.src=v; s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s) }(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('init', CONFIG.facebookPixelId); fbq('track', 'PageView'); window.fbq = fbq; } // --- Google Analytics --- if (CONFIG.enabled.googleAnalytics && CONFIG.googleAnalyticsId) { window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', CONFIG.googleAnalyticsId); window.gtag = gtag; // Load GA script const script = document.createElement('script'); script.async = true; script.src = `https://www.googletagmanager.com/gtag/js?id=${CONFIG.googleAnalyticsId}`; document.head.appendChild(script); } // --- LinkedIn Insight Tag --- if (CONFIG.enabled.linkedIn && CONFIG.linkedInPartnerId) { window.lintrk = function(a,b){window.lintrk.q.push([a,b])}; window.lintrk.q = []; const script = document.createElement('script'); script.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js'; document.head.appendChild(script); lintrk('track', { conversion_id: CONFIG.linkedInPartnerId }); window.lintrk = lintrk; } // --- Pinterest Tag --- if (CONFIG.enabled.pinterest && CONFIG.pinterestTagId) { !function(e){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var n=window.pintrk;n.queue=[],n.version="3.0";var t=document.createElement("script");t.async=!0,t.src=e;var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js"); pintrk('load', CONFIG.pinterestTagId); pintrk('page'); window.pintrk = pintrk; } // --- TikTok Pixel --- if (CONFIG.enabled.tiktok && CONFIG.tiktokPixelId) { !function (w, d, t) { w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i this.syncToN8n(), 3000); }, async syncToN8n() { if (eventQueue.length === 0) return; const events = [...eventQueue]; eventQueue.length = 0; try { await fetch(CONFIG.n8nWebhook, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ feature: 'brand_monitoring', events: events, source: 'remarketing_pixels', sessionId: this.getSessionId() }) }); } catch(e) { console.error('Failed to sync events to n8n:', e); // Put events back in queue eventQueue.unshift(...events); } }, storeLocal(eventData) { try { const events = JSON.parse(localStorage.getItem('brokermind_events') || '[]'); events.push(eventData); localStorage.setItem('brokermind_events', JSON.stringify(events.slice(0, 5000))); } catch(e) {} }, getSessionId() { let sessionId = sessionStorage.getItem('brokermind_session_id'); if (!sessionId) { sessionId = 'sess_' + Date.now() + '_' + Math.random().toString(36).substring(2, 8); sessionStorage.setItem('brokermind_session_id', sessionId); } return sessionId; } }; // ════════════════════════════════════════════════════════════════ // 4. STANDARD EVENT TRACKING // ════════════════════════════════════════════════════════════════ // Page View Track.event('PageView', { page: window.location.pathname, title: document.title, referrer: document.referrer || 'direct' }); // Scroll Depth Tracking let maxScroll = 0; const scrollMilestones = [25, 50, 75, 90]; const trackedMilestones = new Set(); document.addEventListener('scroll', () => { const scrollPercentage = Math.round( (window.scrollY / (document.documentElement.scrollHeight - window.innerHeight)) * 100 ); if (scrollPercentage > maxScroll) { maxScroll = scrollPercentage; for (const milestone of scrollMilestones) { if (scrollPercentage >= milestone && !trackedMilestones.has(milestone)) { trackedMilestones.add(milestone); Track.event('Scroll_' + milestone, { percentage: milestone }); } } } }); // Time on Page let pageStartTime = Date.now(); let pageVisits = 0; document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') { pageVisits++; if (pageVisits > 1) { Track.event('PageRevisit', { visitNumber: pageVisits, timeSinceLast: Date.now() - pageStartTime }); } pageStartTime = Date.now(); } else if (document.visibilityState === 'hidden') { const timeOnPage = Date.now() - pageStartTime; if (timeOnPage > 10000) { // Only track if >10 seconds Track.event('TimeOnPage', { seconds: Math.round(timeOnPage / 1000) }); } } }); // Exit Intent document.addEventListener('mouseleave', (e) => { if (e.clientY < 50 && !document.querySelector('#bm-window')) { Track.event('ExitIntent', { page: window.location.pathname }); } }); // Click Tracking document.addEventListener('click', (e) => { const target = e.target.closest('a, button, .clickable'); if (target) { const text = target.textContent?.trim()?.slice(0, 50) || ''; const href = target.href || ''; const id = target.id || ''; const className = target.className || ''; // Don't track clicks on the chat widget if (target.closest('#bm-widget, #brokermind-widget')) return; Track.event('Click', { text: text, href: href, id: id, className: className, tagName: target.tagName }); } }); // Form Interactions document.addEventListener('focusin', (e) => { if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT') { const form = e.target.closest('form'); Track.event('FormInteraction', { fieldName: e.target.name || e.target.id || '', fieldType: e.target.type || e.target.tagName, formId: form?.id || '' }); } }); // Form Submission document.addEventListener('submit', (e) => { const form = e.target; const formData = new FormData(form); const data = {}; for (let [key, value] of formData.entries()) { data[key] = value; } Track.event('FormSubmit', { formId: form.id || '', formAction: form.action || '', formMethod: form.method || 'GET', fields: Object.keys(data) }); }); // ════════════════════════════════════════════════════════════════ // 5. REAL ESTATE SPECIFIC EVENTS // ════════════════════════════════════════════════════════════════ // Track property views window.BrokerMindRemarketing = { track: Track.event.bind(Track), // Property-specific events viewProperty(propertyId, propertyData) { Track.event('ViewProperty', { propertyId: propertyId, price: propertyData?.price, type: propertyData?.type, location: propertyData?.location, bedrooms: propertyData?.bedrooms }); }, saveProperty(propertyId) { Track.event('SaveProperty', { propertyId: propertyId, timestamp: new Date().toISOString() }); }, shareProperty(propertyId, platform) { Track.event('ShareProperty', { propertyId: propertyId, platform: platform || 'unknown', timestamp: new Date().toISOString() }); }, searchProperties(filters) { Track.event('SearchProperties', { filters: filters, timestamp: new Date().toISOString() }); }, requestViewing(propertyId, date, time) { Track.event('RequestViewing', { propertyId: propertyId, date: date, time: time, timestamp: new Date().toISOString() }); }, leadSubmission(leadData) { Track.event('LeadSubmission', { name: leadData.name, email: leadData.email, phone: leadData.phone, budget: leadData.budget, location: leadData.location, timestamp: new Date().toISOString() }); }, hotLead(leadData) { Track.event('HotLead', { name: leadData.name, budget: leadData.budget, location: leadData.location, intent: leadData.intent, score: leadData.score, timestamp: new Date().toISOString() }); }, bookingConfirmed(bookingData) { Track.event('BookingConfirmed', { propertyId: bookingData.propertyId, date: bookingData.date, time: bookingData.time, timestamp: new Date().toISOString() }); } }; // ════════════════════════════════════════════════════════════════ // 6. LOAD PIXELS // ════════════════════════════════════════════════════════════════ // Wait for page to load before loading pixels if (document.readyState === 'complete') { loadPixels(); } else { window.addEventListener('load', loadPixels); } console.log('✅ BrokerMind Remarketing System initialized'); })();