# Set Up Analytics Tracking (/how-to/checkout/set-up-analytics-tracking)



Resytech has built-in fields for Google Analytics 4 (GA4) and Facebook Pixel. Enter your tracking IDs and the checkout automatically loads the appropriate scripts, sends pageview events, and fires conversion events on completed purchases -- no custom JavaScript required.

Before you begin [#before-you-begin]

* You need a Google Analytics 4 property and its Measurement ID (starts with `G-`), a Facebook Pixel ID, or both.
* You need access to the Resytech Dashboard with permission to edit checkout settings.

Add Google Analytics tracking [#add-google-analytics-tracking]

1. Navigate to **Dashboard > Checkout Settings**.
2. Select the **Advanced** tab from the sidebar.
3. Scroll to the **Analytics & Tracking** section.
4. Enter your GA4 Measurement ID in the **Google Analytics Tracking ID** field (e.g., `G-XXXXXXXXXX`).
5. Click **Save Changes**.

Once saved, the checkout page automatically:

* Loads the Google Analytics gtag.js script.
* Sends a `page_view` event on every checkout page load.
* Fires a `purchase` event with transaction details when a booking is completed.

Add Facebook Pixel tracking [#add-facebook-pixel-tracking]

1. On the same **Advanced** tab, enter your Facebook Pixel ID in the **Facebook Pixel ID** field (e.g., `1234567890123456`).
2. Click **Save Changes**.

Once saved, the checkout page automatically:

* Loads the Facebook Pixel base code.
* Fires a `PageView` event on page load.
* Fires a `Purchase` event with value and currency when a booking is completed.

Track custom conversion events [#track-custom-conversion-events]

If you need tracking beyond what the built-in fields provide, use the **Purchase Complete JavaScript** field to fire custom events. This is useful for platforms like Google Tag Manager, TikTok Pixel, or custom attribution systems.

```javascript
window.addEventListener('BookingUI:purchaseComplete', function(event) {
  var data = event.detail;

  // Example: Google Ads conversion
  if (window.gtag) {
    gtag('event', 'conversion', {
      send_to: 'AW-XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX',
      value: data.totalAmount,
      currency: 'USD',
      transaction_id: data.bookingId
    });
  }

  // Example: TikTok Pixel
  if (window.ttq) {
    ttq.track('CompletePayment', {
      value: data.totalAmount,
      currency: 'USD'
    });
  }
});
```

See [Add Custom CSS and Scripts](/how-to/checkout/add-custom-css-and-scripts) for the full list of available event data and more examples.

Verify your setup [#verify-your-setup]

Google Analytics [#google-analytics]

1. Open Google Analytics and go to **Realtime** overview.
2. Open your checkout page in a new browser tab.
3. Confirm that a pageview appears in the realtime report.
4. Complete a test booking and verify that a `purchase` event appears in the realtime events list.

Facebook Pixel [#facebook-pixel]

1. Install the [Meta Pixel Helper](https://developers.facebook.com/docs/meta-pixel/support/pixel-helper) Chrome extension.
2. Open your checkout page.
3. The extension icon should show a green checkmark and list the `PageView` event.
4. Complete a test booking and confirm the `Purchase` event fires.

Tips [#tips]

* **Use GA4 Measurement IDs, not Universal Analytics.** Universal Analytics (IDs starting with `UA-`) is no longer supported by Google. Only GA4 IDs (`G-`) work with the built-in integration.
* **You can use both GA4 and Facebook Pixel simultaneously.** They operate independently and do not conflict.
* **The built-in fields are simpler than manual scripts.** If you only need standard pageview and purchase tracking, use the tracking ID fields rather than writing custom JavaScript. The built-in integration handles script loading, deduplication, and event formatting automatically.
* **Purchase Complete JavaScript runs in addition to built-in tracking.** If you have a GA4 ID configured and also write a manual `gtag('event', 'purchase')` in the Purchase Complete JavaScript field, the purchase event may be sent twice. Use one approach or the other for each platform.

Related guides [#related-guides]

* [Add Custom CSS and Scripts](/how-to/checkout/add-custom-css-and-scripts) -- for advanced tracking scenarios using custom JavaScript.
* [Configure Checkout Settings](/how-to/checkout/configure-checkout-settings) -- set the return URL to redirect customers after purchase, which can include UTM parameters for campaign tracking.
