iFrame

This is an iFrame of the Rezdy Booking Form:

It uses the two codes below:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1234567890-1"></script>

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-1234567890-1', {
  'linker': {
    'domains': ['rezdy.com']
    }
  })
</script>

and below the iframe, just above the footer:

<script>
function check_ga() {
  if (typeof ga === 'function') {
     ga(function(tracker) {

       // When using Google Tag Manager there is no default tracker
       if (tracker == undefined) {
         tracker = ga.getAll()[0];
       }

       // Gets the client ID of the default tracker.
       var gaClientId = tracker.get('clientId');

       // Gets all iframes on the page
       var rezdyElements = document.getElementsByClassName('rezdy');

       for (var i = 0; i < rezdyElements.length; i++) {
         if (rezdyElements[i].contentWindow) {
             
             // Wait for Iframe receiver to be loaded
             rezdyElements[i].addEventListener("load", function() {
               // Make sure you use your own company Alias here
               this.contentWindow.postMessage(gaClientId, 'https://myalias.rezdy.com');
             });
         }
       }
    });
  } else {
    setTimeout(function(){check_ga();},500);
  }
}
check_ga();
</script>