Home Features How It Works Pricing Integrations FAQ Contact
← Back to Integrations Integrations · Plain HTML

No backend? No problem.

Everything — the embed and the campaign tracking — runs client-side in JavaScript, since there's no server to process the company key or the tracking parameters.

// 01

Sitewide tracking + retrieval function

Add this to the <head> or just before </body> on every page of the site:

<script>
(function(){
  var KEYS = ['gclid','gbraid','wbraid','utm_source','utm_medium','utm_campaign','utm_term','utm_content','fbclid'];

  // Stores a cookie if this page has any of them in the URL
  KEYS.forEach(function(k){
    var m = new RegExp('[?&]'+k+'=([^&#]*)').exec(window.location.href);
    if(m){
      document.cookie = 'fb_' + k + '=' + m[1] + ';max-age=7776000;path=/;SameSite=Lax';
    }
  });

  // Used by the embeds below to retrieve it
  window.fbGetTrackingParams = function(){
    var qs = '';
    KEYS.forEach(function(k){
      var m = new RegExp('[?&]'+k+'=([^&#]*)').exec(window.location.href);
      var val = m ? m[1] : null;
      if(!val){
        var match = document.cookie.match(new RegExp('(^| )fb_' + k + '=([^;]+)'));
        if(match) val = match[2];
      }
      if(val) qs += '&' + k + '=' + val;
    });
    return qs;
  };
})();
</script>
// 02

Compact widget

<div id="fb-widget-container"></div>

<script>
(function(){
  var container = document.getElementById('fb-widget-container');
  var params = 'k=YOUR_COMPANY_KEY&lng=gb';
  var tracking = window.fbGetTrackingParams ? window.fbGetTrackingParams() : '';

  var iframe = document.createElement('iframe');
  iframe.src = 'https://app.farebookings.com/booking-widget.php?' + params + tracking;
  iframe.width = '100%';
  iframe.height = '640';
  iframe.frameBorder = '0';
  iframe.scrolling = 'no';
  iframe.style.border = 'none';
  container.appendChild(iframe);
})();
</script>
// 03

Full booking form

<div id="fb-form-container"></div>

<script>
(function(){
  var container = document.getElementById('fb-form-container');
  var params = 'k=YOUR_COMPANY_KEY&d=pp&lng=gb';
  var tracking = window.fbGetTrackingParams ? window.fbGetTrackingParams() : '';

  var iframe = document.createElement('iframe');
  iframe.src = 'https://app.farebookings.com/step1sslv3.php?' + params + tracking;
  iframe.width = '100%';
  iframe.style.border = 'none';
  iframe.style.minHeight = '1400px';
  iframe.scrolling = 'no';
  container.appendChild(iframe);
})();
</script>

Replace YOUR_COMPANY_KEY with the real key from the Frontend tab of your panel, in both snippets above.

// Common options
Dark modeAdd &dark=1 to params.
Options panel openAdd &opts_open=1 to params.
LanguageChange lng=gb to lng=es, lng=fr, etc.
// Checking it worked

Verifying tracking works

  1. Visit any page with ?gclid=test123 on the end of the URL.
  2. Open the browser console (F12) → type document.cookie.
  3. fb_gclid=test123 should be there.
  4. Navigate to another page (without the parameter) and confirm the cookie is still there before reaching the widget/form.

Building on a different platform?

There are dedicated guides for WordPress and plain PHP sites.