ResytechResytech Docs
Checkout Customization

Add Custom CSS and Scripts

How to inject custom CSS, JavaScript, and purchase-complete tracking scripts into the Resytech booking checkout.

The Advanced tab lets you add custom CSS for pixel-perfect styling, JavaScript for enhanced functionality, and purchase-complete scripts for conversion tracking. Use these fields when the built-in theme options are not enough.

Before you begin

  • You need access to the Resytech Dashboard with permission to edit checkout settings.
  • You should be comfortable writing CSS and/or JavaScript. Errors in custom code can break the checkout experience.
  • For analytics tracking IDs (GA4 or Facebook Pixel), see Set Up Analytics Tracking instead -- those have dedicated fields.

Steps

  1. Navigate to Dashboard > Checkout Settings.
  2. Select the Advanced tab from the sidebar.
  3. Enter your code in the appropriate section (see below).
  4. Click Save Changes.

Custom CSS

The Custom CSS field accepts any valid CSS. Styles are injected into the checkout page and apply to all elements.

CSS variables

The checkout exposes the following CSS custom properties that reflect your theme settings:

--primary-color
--secondary-color
--accent-color
--background-color

You can reference these in your custom CSS to stay consistent with the theme:

.my-custom-element {
  color: var(--primary-color);
  border: 2px solid var(--accent-color);
}

Example: override card styles

/* Increase card rounding and add a colored border */
.activity-card {
  border-radius: 20px;
  border: 2px solid var(--primary-color);
  transition: transform 0.3s ease;
}

.activity-card:hover {
  transform: translateY(-4px);
}

/* Custom gradient button */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

Example: load a custom font

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&display=swap');

body {
  font-family: 'Playfair Display', serif;
}

The editor includes a Format button that auto-indents your CSS for readability.

Custom JavaScript

The Custom JavaScript field runs after the checkout page loads. Use it for advanced DOM manipulation, third-party widget integration, or custom event handling.

Your script runs once when the checkout page finishes loading -- there are no separate "ready" events to wait for. To react to the purchase event specifically, use the Purchase Complete JavaScript field below.

Example: inject a third-party chat widget

// Load Drift chat widget
!function() {
  var t = window.driftt = window.drift = window.driftt || [];
  // ... Drift initialization code
}();

Purchase Complete JavaScript

This script runs only after a successful booking purchase. It is ideal for conversion tracking, thank-you popups, or triggering external workflows.

Available data

Your script receives the purchase information as purchaseData:

PropertyTypeDescription
confirmationCodestringUnique booking confirmation code.
totalPaidnumberThe booking's total, in your company's currency: the price of what was booked. A tip the customer added is not part of it.
currencystringYour company's currency code, for example USD or DKK. Pass it to tracking tools instead of a fixed currency.
activityobjectThe booked activity.
equipmentarrayEquipment included with the booking.
rawobjectFull serialized shopping cart for advanced use.

Just before your script runs, the checkout also fires a checkout-complete event on window with the same data in event.detail (only when this field has a script). A listener added in this field would be too late for that event, so read purchaseData here.

Example: track a purchase conversion

var data = purchaseData;

// Google Analytics 4 purchase event
if (window.gtag) {
  gtag('event', 'purchase', {
    transaction_id: data.confirmationCode,
    value: data.totalPaid,
    currency: data.currency,
    items: [data.activity]
  });
}

// Facebook Pixel purchase event
if (window.fbq) {
  fbq('track', 'Purchase', {
    value: data.totalPaid,
    currency: data.currency
  });
}

Example: redirect after purchase

// Wait 3 seconds, then redirect
setTimeout(function() {
  window.location.href = 'https://yoursite.com/thank-you?booking=' + purchaseData.confirmationCode;
}, 3000);

Tips

  • Test custom JavaScript carefully. Syntax errors or unhandled exceptions can break the checkout flow. Test in a browser console first.
  • Custom CSS takes precedence over theme colors. If you set a color in Custom CSS that conflicts with a theme color, the CSS value wins due to specificity.
  • Purchase Complete scripts only run on success. They will not fire for failed or abandoned checkouts.
  • Use the Format button. The CSS editor includes a formatting tool that adds proper indentation. Click the wand icon in the section header.
  • Keep scripts lightweight. Heavy scripts increase page load time, which can reduce conversion rates. Load external libraries asynchronously when possible.

On this page