Usermaven
Dark mode

How to track FareHarbor booking events with Usermaven

This guide explains how to track FareHarbor booking events in Usermaven using Google Tag Manager (GTM).

Since FareHarbor runs inside an iframe, booking interactions are not automatically captured by the Usermaven pixel. Some FareHarbor GA4/Lightframe configurations expose booking events to the parent page’s GTM data layer, allowing you to capture them with GTM and forward them to Usermaven. If the events do not appear in the parent container’s GTM Preview, this method cannot be used without further FareHarbor configuration.

After completing this guide, you'll be able to track FareHarbor booking interactions in Usermaven, view the interactions in Custom Events and use them in reports such as Journeys, Funnels, and Conversion Goals.


How the implementation works

The recommended setup consists of three components:

  1. Public website

    • Install the Usermaven base pixel directly on your website.

  2. Booking journey

    • Capture FareHarbor booking events from the parent page's data layer using Google Tag Manager and forward them to Usermaven.


Prerequisites

Before configuring GTM, verify the following:

  • Usermaven pixel is installed exactly once on the public website.

  • The FareHarbor GA4 integration is configured correctly.

  • GTM container is installed on the public website, and you have edit and publish access to it.


Discovering FareHarbor Events with GTM Preview

You will need to first find out which events FareHarbor pushes to your website's data layer. Follow the steps below

  • Connect GTM Preview to the public website.

  • Open FareHarbor from the website rather than navigating directly to FareHarbor.

  • Visit every available booking step.

  • Select each FareHarbor event in Tag Assistant.

  • Inspect the Data Layer tab for event and eventModel.

  • Inspect the Variables tab to confirm the data-layer variables resolve.

  • Record the exact event names, company_shortname, send_to, and available properties

  • Check whether the same logical event appears more than once with different send_to values

  • Stop configuration if no events appear.

If the events do not appear in the GTM Preview, this method cannot be used without further FareHarbor configuration.


Choose the FareHarbor events to forward

FareHarbor can push booking-related events to the parent page's data layer. These events can be captured with GTM and forwarded to Usermaven.

The events available depend on your FareHarbor implementation and booking flow.

Common booking events may include some or all of the following. You may also see a Purchase event.

Event

Availability

view_item_grid

Browse activities page

view_search_by_date

Search-by-date page

view_calendar

All-items calendar

view_calendar_single_item

Single-item calendar

view_item_description

Item description

view_book_form

Customer type and quantity form

add_to_cart

Only when the shopping cart is enabled

Note: The events available in your implementation depend on your FareHarbor configuration. Use GTM Preview to verify which events are available before configuring your forwarding tag.


Configure FareHarbor event forwarding

Step 1: Enable the Event variable

  1. Open Variables.

  2. Under Built-In Variables, click Configure.

  3. Enable the Event variable if it is not already enabled.

The Event variable provides the current FareHarbor event name to the forwarding tag.


Step 2: Create the Data Layer variables

Create the following Data Layer Variables if they do not already exist.

  1. eventModel: supplies the complete properties object.

  2. eventModel.company_shortname: restricts forwarding to the intended FareHarbor account.

  3. eventModel.send_to(Optional) selects one event copy when multiple GA destinations cause duplicates. This is not required if GTM Preview shows only one copy

GTM variable name

Data Layer variable name

DLV - eventModel

eventModel

DLV - eventModel.send_to

eventModel.send_to

DLV - eventModel.company_shortname

eventModel.company_shortname

For each variable:

  1. Open Variables.

  2. Click New.

  3. Select Data Layer Variable.

  4. Enter the corresponding Data Layer Variable Name.

  5. Select Version 2.

  6. Save the variable.

Existing variables such as eventModel.item_id, eventModel.item_name, eventModel.currency, eventModel.value, and eventModel.items may already exist for other integrations. These can remain in your container, as the forwarding tag reads the complete eventModel object.


Step 3: Create the Custom Event trigger

  1. Open Triggers.

  2. Click New.

  3. Select Custom Event.

  4. Enter a regular expression that matches the FareHarbor events you want to forward. For the variables listed above, for example
    ^(view_item_grid|view_search_by_date|view_item_description|view_calendar|view_calendar_single_item|view_book_form|add_to_cart)$

  5. Enable Use regex matching.

  6. Select Some Custom Events.

  7. Configure any additional trigger conditions required for your implementation. For example
    DLV - eventModel.company_shortname equals <observed company shortname>

Depending on your FareHarbor setup, you may need additional conditions to:

  • Prevent duplicate events from being forwarded. When GTM Preview confirms duplicate event copies you can use a condition like DLV - eventModel.send_to equals <selected measurement ID> to ensure only one event gets sent to Usermaven

  • Restrict the trigger to a specific booking instance.

  • Filter only the events you want to send to Usermaven.


Step 4: Create the Usermaven forwarding tag

  1. Open Tags.

  2. Click New.

  3. Select Custom HTML.

  4. Paste your FareHarbor forwarding script. An example is given below, you will need to customise it according to your configuration

  5. Attach the tag to the FareHarbor Custom Event trigger.

  6. Leave the firing option set to Once per event.

  7. Save the tag.

<script>​
(function () {​ // Queues the call if Usermaven has not finished loading
  window.usermaven = window.usermaven || function () {​
    (window.usermavenQ = window.usermavenQ || []).push(arguments);​
  };​
​
  var sourceEvent = "{{Event}}";​
  var eventModel = {{DLV - eventModel}} || {};​
  var properties = {};​
  var supportedProperties = [​
    "company_shortname",​
    "page_location",​
    "page_title",​
    "availability_id",​ 
    "item_id",​
    "item_name",​
    "currency",​
    "value",​
    "items"​
  ];​
​
  supportedProperties.forEach(function (propertyName) {​
    var propertyValue = eventModel[propertyName];​
    if (​
      propertyValue !== undefined &&​ propertyValue !== null &&​ propertyValue !== ""​
    ) {​
      properties[propertyName] = propertyValue;​
    }​
  });​
  window.usermaven("track", sourceEvent, properties);​
})();​
</script>

Important

  • Do not install another Usermaven base pixel inside this tag. The forwarding tag assumes the Usermaven base pixel is already installed on your website.

  • If Usermaven is installed on your site through GTM, you can remove the Usermaven check at the beginnign and use GTM Tag Sequencing instead


Test the implementation

After configuring the trigger and forwarding tag:

  1. Open GTM Preview.

  2. Start a booking journey from your website.

  3. Proceed through every available step in the booking flow.

  4. Verify that FareHarbor events generated during the booking process are captured in GTM.

  5. Verify that the Variable DLV - eventModel resolves to an object.

  6. Confirm that the Usermaven forwarding tag fires for the expected events.

  7. Verify that the expected event properties are available.

  8. Verify that the forwarded properties contain actual values, not placeholders.

  9. Confirm that duplicate events, if present, are not forwarded multiple times.

Do not publish your GTM container until the implementation has been fully validated.


Verify events in Usermaven

After successful GTM testing:

  1. Open your Usermaven workspace.

  2. Navigate to Configure → Events Activity (or Custom Events).

  3. Verify that the forwarded FareHarbor events appear.

  4. Confirm that the expected event properties are present and contain the expected values.

  5. Confirm that the events belong to the same visitor journey that initiated the booking flow.

Allow a few minutes for newly tracked events to appear.


Publish the Container

After successful GTM Preview testing, submit and publish the GTM container with a descriptive version name such as "Usermaven FareHarbor Integration - Date". Then repeat a live test outside Preview


Troubleshooting

FareHarbor events do not appear in GTM Preview

Verify that the FareHarbor GA4 integration is enabled and that GTM Preview is connected to the correct website and container. If the events do not appear in the parent page’s data layer, they cannot be forwarded to Usermaven using this method.

Duplicate events appear in Usermaven

Check whether FareHarbor sends the same event to multiple send_to values. Update the trigger to match only one selected send_to value. Also verify that the website does not load the
same GTM container more than once.

Events from the wrong FareHarbor account are forwarded

Add a trigger condition that matches the exact eventModel.company_shortname value for the intended FareHarbor account.

Expected event properties are missing

FareHarbor does not include every property with every event. Inspect the event in GTM Preview to confirm which properties are available for that booking stage.

The Usermaven forwarding tag does not fire

Verify that:

  • The event name matches the trigger exactly.

  • Regular expression matching is enabled when using a regex.

  • The company_shortname and send_to conditions match the values shown in GTM Preview.

  • The event is being inspected in the correct GTM container.

The event does not appear in Usermaven

Verify that the Usermaven base pixel loads successfully and is installed only once. Check whether browser extensions, consent settings, or content blockers are preventing Usermaven or GTM from loading. Confirm in GTM Preview that the forwarding tag fired successfully, then allow a few minutes for the event to appear in Usermaven.


Browser limitations

  • The Usermaven base pixel continues to work even if GTM is unavailable or blocked.

  • FareHarbor event forwarding depends on GTM. If GTM is blocked, FareHarbor events cannot be forwarded to Usermaven.



Was this article helpful?