Skip to content
  • Procurement Portal
  • Support
  • Optimise IT
  • Phone Icon Print & Comms 0330 175 5588
  • Phone Icon MSP Sales 0303 003 3579
Logo White
  • Solutions
    • By capability
      • Managed services
      • Flexible resource
      • Project delivery
      • Technology purchases
    • By need
      • Extend your IT capabilities
      • Support your in-house IT team
      • Switch your MSP partner
      • Optimise cost & resources
    • By service
      • Cloud services
      • IT services
      • Cyber security
      • Voice & networks
      • Print & documents
      • All services
  • Who we help
    • Col1
      • SME
    • Col2
      • Enterprise
    • Col3
      • Public sector
  • Who we are
    • Col1
      • Our story
      • Our team
      • Our partners
      • Our support
      • ESG credentials
      • Careers
    • Insights
      • Blog
      • News
      • Press Coverage
      • Optimise IT
  • Customer stories
  • Get in touch
Espria Logo for Case Studies
  • Solutions
    • By capability
      • Managed services
      • Flexible resource
      • Project delivery
      • Technology purchases
    • By need
      • Extend your IT capabilities
      • Support your in-house IT team
      • Switch your MSP partner
      • Optimise cost & resources
    • By service
      • Cloud services
      • IT services
      • Cyber security
      • Voice & networks
      • Print & documents
      • All services
  • Who we help
    • SME
    • Enterprise
    • Public sector
  • Who we are
    • About
      • Our story
      • Our team
      • Our partners
      • Our support
      • ESG credentials
      • Careers
    • Insights
      • Blog
      • News
      • Press Releases
      • Optimise IT
  • Customer stories
  • Get in touch
  • Procurement Portal
  • Support
  • Print & Comms Phone Icon 0330 175 5588
  • MSP Sales Phone Icon 0330 175 5588

Technology is a powerful tool for mitigating increasing business costs

By Former CTO | August 22, 2023

Dave Adamson, CTO of Espria, discusses how technology can mitigate increasing business costs without sacrificing business efficiency.

Read More

Team17 – Using Power BI to Improve Reporting & Business Decision Making

By Sarah Gowans | July 26, 2023

A multi-award-winning video game development company got in touch with Espria to discuss improving their reporting and utilisation of their data.

Read More

The Development Bank of Wales – Managing a Laptop Refresh Project

By Sarah Gowans | June 27, 2023

The Development Bank of Wales is a public sector finance company employing almost 300 people based in Wales. Espria were engaged to manage a laptop refresh project.

Read More

National Association of Head Teachers – Managing a Move to the Cloud

By Sarah Gowans | June 16, 2023

Following the pandemic, NAHT was able to expedite its long-term plan to go fully cloud-based and complete the move from their bricks and mortar head office to the cloud in 2023.

Read More

The Importance of a Sustainable IT Business Model

By Espria HR Team | March 1, 2023

As ESG becomes a critical driver for many decision-makers, Clinton Groome, Espria COO, reveals why adopting sustainable business practices is an opportunity.

Read More

Allvotec – Solving High Priority Issues in Minutes

By Sarah Gowans | January 18, 2023

Allvotec have over 30 years’ of experience in delivering value through technology, but faced an issue surrounding an SQL admin skills gap. Allvotec drafted in Espria to fill in the role of answering their highest priority issues.

Read More

Digital Workplace Solutions Framework – Simple, Reliability Guaranteed and Potential for Huge Cost Savings

By Sarah Gowans | September 15, 2022

Espria is proud to be an accredited supplier to Shared Business Services Digital Workplace Solutions Framework. Espria has a rich history of providing innovative technology solutions to public sector agencies and departments that have returned real-time financial and efficiency savings.

Read More

Look to the Future with Digital Transformation

By Chris Kuhnel | July 12, 2022

A buzz phrase that has been used increasingly is digital transformation, but what is it and why could it be crucial to your business’ future success?

Read More

5 Reasons why the best security for your business is in the Cloud

By Sarah Gowans | June 7, 2022

Security has always been a concern for businesses implementing the cloud. However, the Cloud offers the best security for any size of company and these are our 5 reasons why.

Read More

10 Reasons Why your Business needs Cloud Services

By Sarah Gowans | May 25, 2022

Agility, flexibility and ultimate security are the key reasons why Cloud Services should be implemented in your business.

Read More
« Newer Posts
Older Posts »
Logo Blue

Resources

  • Blog
  • News
  • Press Releases
  • Optimise IT
  • Book your Microsoft 365 assessment
  • Book your Microsoft Azure optimisation assessment

Access Links

  • Services
  • Sectors
  • Partners
  • Contact Us

Contact Details

  • 0330 175 5588
  • Ware - Head Office, Thundridge Business Park, Thundridge, Herts, SG12 0SS
  • St Ives, Suite 1 James Hall, Parsons Green, St Ives, Cambridgeshire, PE27 4AA
  • Suite 7, Alexandra House, Winchester Hill, Romsey, Hampshire SO51 7ND

Sign up to our newsletter

  • View my bill
  • Terms & conditions
  • Privacy policy
  • Policy statements
(function() { 'use strict'; // Initialize dataLayer if it doesn't exist window.dataLayer = window.dataLayer || []; // Function to push form submit event to dataLayer function pushFormSubmitEvent() { window.dataLayer.push({ 'event': 'form_submit', 'form_type': 'microsoft_booking', 'form_location': 'consultation_booking', 'form_id': 'booking_iframe', 'timestamp': new Date().toISOString() }); console.log('Microsoft Booking Form Submit Event Pushed to GTM'); } // Method 1: Listen for postMessage from Microsoft Booking iframe function setupPostMessageListener() { window.addEventListener('message', function(event) { // Check if message is from Microsoft Booking system if (event.origin.includes('outlook.office365.com') || event.origin.includes('bookings.office.com') || event.origin.includes('office365.com')) { console.log('Message received from booking system:', event.data); // Look for booking completion/submission indicators if (event.data) { // Check for various success indicators const data = typeof event.data === 'string' ? event.data.toLowerCase() : event.data; if (typeof data === 'string') { if (data.includes('booking') && (data.includes('success') || data.includes('complete') || data.includes('confirm'))) { pushFormSubmitEvent(); } } else if (typeof data === 'object') { if (data.type === 'booking_completed' || data.action === 'submit' || data.status === 'success' || data.event === 'booking_success' || data.messageType === 'booking_confirmed') { pushFormSubmitEvent(); } } } } }); } // Method 2: Monitor iframe URL changes (if accessible) function monitorIframeChanges() { const iframe = document.querySelector('iframe[src*="outlook.office365.com/book"]'); if (iframe) { // Try to monitor iframe for navigation changes let lastUrl = ''; const checkIframeUrl = function() { try { // This will fail due to CORS, but we can still detect some changes const currentUrl = iframe.contentWindow.location.href; if (currentUrl !== lastUrl) { lastUrl = currentUrl; // Check if URL indicates booking completion if (currentUrl.includes('success') || currentUrl.includes('complete') || currentUrl.includes('confirmation')) { pushFormSubmitEvent(); } } } catch (e) { // Expected to fail due to CORS, but iframe load events might still work } }; // Monitor iframe load events iframe.addEventListener('load', function() { console.log('Booking iframe loaded/navigated'); setTimeout(checkIframeUrl, 1000); }); // Periodic check (as backup) setInterval(checkIframeUrl, 2000); } } // Method 3: Monitor iframe height changes (booking systems often resize after submission) function monitorIframeResize() { const iframe = document.querySelector('iframe[src*="outlook.office365.com/book"]'); if (iframe) { let initialHeight = iframe.offsetHeight; let hasResized = false; const observer = new ResizeObserver(function(entries) { for (let entry of entries) { const newHeight = entry.contentRect.height; // If iframe significantly changes height after initial load, might indicate form submission if (Math.abs(newHeight - initialHeight) > 100 && !hasResized) { hasResized = true; console.log('Booking iframe resized significantly - possible form submission'); // Wait a bit more to see if it's a submission confirmation setTimeout(function() { pushFormSubmitEvent(); }, 2000); } } }); // Start observing after iframe loads iframe.addEventListener('load', function() { setTimeout(function() { initialHeight = iframe.offsetHeight; observer.observe(iframe); }, 1000); }); } } // Method 4: Enhanced interaction monitoring with focus detection function monitorUserInteraction() { const iframe = document.querySelector('iframe[src*="outlook.office365.com/book"]'); if (iframe) { let interactionStartTime = null; let hasInteracted = false; let focusTimeout = null; // Detect when user starts interacting with iframe iframe.addEventListener('mouseenter', function() { if (!interactionStartTime) { interactionStartTime = Date.now(); console.log('User started interacting with booking form'); } }); // Detect when iframe gains focus (user clicked inside) window.addEventListener('blur', function() { // Window lost focus, possibly because iframe gained focus if (interactionStartTime && !hasInteracted) { hasInteracted = true; console.log('User likely clicked inside booking iframe'); // Set up a longer timeout for form submission detection focusTimeout = setTimeout(function() { // Check if user is still interacting (form submission likely occurred) const interactionDuration = Date.now() - interactionStartTime; if (interactionDuration > 30000) { // 30 seconds of interaction console.log('Long interaction detected - likely form submission'); pushFormSubmitEvent(); } }, 45000); // Wait 45 seconds } }); // Cancel timeout if window regains focus quickly (user didn't submit) window.addEventListener('focus', function() { if (focusTimeout && (Date.now() - interactionStartTime) < 10000) { clearTimeout(focusTimeout); console.log('Quick focus return - probably not a form submission'); } }); } } // Method 5: Network activity monitoring (experimental) function monitorNetworkActivity() { // Monitor fetch/XHR requests that might indicate form submission const originalFetch = window.fetch; const originalXHR = window.XMLHttpRequest.prototype.open; // Intercept fetch requests window.fetch = function(...args) { const url = args[0]; if (typeof url === 'string' && (url.includes('outlook.office365.com') || url.includes('bookings.office.com'))) { console.log('Booking-related network request detected:', url); // If it's a POST request to booking endpoints, likely a form submission if (args[1] && args[1].method === 'POST') { setTimeout(function() { pushFormSubmitEvent(); }, 1000); } } return originalFetch.apply(this, args); }; } // Initialize all tracking methods function initializeTracking() { console.log('Initializing Microsoft Booking iframe tracking...'); setupPostMessageListener(); monitorIframeChanges(); monitorIframeResize(); monitorUserInteraction(); monitorNetworkActivity(); console.log('Microsoft Booking tracking initialized'); } // Wait for iframe to be available function waitForIframe() { const iframe = document.querySelector('iframe[src*="outlook.office365.com/book"]'); if (iframe) { initializeTracking(); } else { setTimeout(waitForIframe, 1000); } } // Start tracking when DOM is ready if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', waitForIframe); } else { waitForIframe(); } })();