Custom Code Guide for Website-Integrators
Last updated: October 9, 2025
Custom code requests are the most complex requests that integrators complete. Use this guide as a framework for what custom code is, and how to complete and troubleshoot requests.
For specific instruction on how to implement a certain pixel, see Pixel Specific Implementation
What is custom code?
With any online business, marketing and analytic managers offer a variety of insights that allow businesses the ability to see how customers are interacting with their business. By analyzing information such as page clicks, time spent on the site, and conversion information, businesses are able to adjust their approach to optimize conversions and cater to their specific market.
An important part of this is analyzing conversion patterns: what items are selling, who is buying them, etc. To report this information in real time, marketing managers provide “pixels” or bits of javascript to be placed on a “thank you” page on the client’s website. This thank you page is only designed to be accessed after a conversion occurs, so when the thank you page is loaded, the conversion pixel fires, and reports relevant information about the most recent conversion.
This can be done within FareHarbor, but the process varies slightly. The entire FareHarbor booking occurs within the Lightframe, which is an iframe technically off of the client’s site. Because of this, typical thank you pages are not able to access the conversion information from the LightFrame. Instead, these pixels must be added to the booking confirmation page within the LightFrame. Custom code is FareHarbor’s feature that allows these pixels to be added and fired on the booking confirmation page within the LightFrame.
These pixels can be customized with specialized variables to report booking specific conversion information to the client’s marketing manager. When a custom code request is sent to Integrators, it is their job to inject the booking variables and add it to the dashboard so it will fire on successful conversion.
How the FareHarbor Product Works
In regards to custom code, the FareHarbor product is simple and fairly customizable. All custom code is loaded into the dashboard via the Analytics and Tracking page in the dashboard’s settings. Google Analytics, Facebook, Adroll, and Optimizely all have built in dashboard functionality. For these services, we only need to add account information from the client’s marketing service, and the FareHarbor product does the rest. All other custom code pixels must be added using the Custom Code option.
When the customer reaches the booking confirmation page, an iframe is loaded into the HTML of the page. This source of the iframe is a custom booking specific link. Within this link there are two things:
- A script that creates the booking variable. This is a JSON object that contains booking specific information such as transaction totals, booking id, item names, etc. Below is an example of what the booking variable looks like.

- Any code added through custom code on the dashboard.

The custom code is able to detect variables from the booking object to be passed into various analytics managers at the time of booking.
Note: The booking variable can be printed at any time by adding the following as custom code, or by entering “booking” into the console from the booking confirmation page.
<script>
console.log(booking)
</script>
General Implementation Flow
Specifics for completing the most common requests are described later in this document, but the general method of implementation is usually the same.
- Claim the request in Airtable
- Copy the code provided into a code editor
- Inject the booking variables where requested
- Test on your demo dashboard to ensure there are no errors
- Add to the client’s dashboard through Analytics and Tracking
- Report as completed in #website-integrations and mark complete in Airtable.
Injecting Variables / Sending conversion information
In order to dynamically send booking information into their analytics manager, many pixels require booking variables to be injected into the code. Since these variables are properties on the booking object, you can use javascript dot notation to reference the different properties.
The booking variable has the following properties:
| Property | Use | Value |
|---|---|---|
booking.pk |
Booking number: unique identifier of booking | integer |
booking.priceInCents |
Subtotal without tax, in cents, like 1390 | integer |
booking.priceInDollars |
Subtotal without tax, in dollars, like ‘13.90’ | string |
booking.taxInCents |
Just tax, in cents, like 120 | integer |
booking.taxInDollars |
Just tax, in dollars, like ‘1.20’ | string |
booking.totalInCents |
Price + tax, in cents, like 1510 | integer |
booking.totalInDollars |
Price + tax, in dollars, like ‘15.10’ | string |
booking.total_in_dollars |
Price + tax, in dollars, like 15.10 | integer |
booking.currency |
Currency transacted, like ‘USD’ | string |
booking.currencyLowercase |
Currency transacted, like ‘usd’ | string |
booking.customerCount |
Total number of customers on this booking | integer |
booking.onlineRef |
The booking ‘ref’, if any | string |
booking.item.pk |
Unique identifier of item | integer |
booking.item.name |
Name of the item | string |
booking.item.sku |
Short/private name of the item | string |
booking.order.uuid |
Unique identifier for the order | string |
booking.order.identifier |
Alternative identifier for the order | string |
booking.order.bookingCount |
Total number of bookings in the order | integer |
booking.company.shortname |
Company’s shortname | string |
booking.company.name |
Company’s name | string |
booking.affiliate.shortname |
Affiliate company’s shortname | string |
booking.affiliate.name |
Affiliate company’s name | string |
There are a few formats in which you can inject variables.
In Javascript
Many pixels operate by creating a javascript object with booking properties, and then sending the whole object to the analytics manager. This object will be set up with key / value pairs. Replace whatever placeholder text is present with the value from the property column above. Take the following example:

In this case, replace the “123.05” static value with booking.totalInDollars. If the client is in the US, we can leave “USD” hardcoded, but if they are in another country, we would change the value for currency to booking.currency. The updated script will look as such:

Note: Ensure that when adding these variables, they are not between quotes. Sending “booking.total_in_dollars” will send a hardcoded string rather than filling in the variable.
In Links and URLS
Clients may also try to load a tag that sends information through a link. To use a variable in links, it must be wrapped in double braces, like {{ booking.pk }} For the following example:
<img src="http://example.com/?sale-id=booking_id&value=booking_total />
Variables would be injected like so:
<img src="http://example.com/?sale-id={{ booking.pk }}&value={{ booking.total_in_dollars }} />
Pixel Specific Implementation
Google Analytics
Google Analytics is unique in that it is the only pixel that can track a customers’ activity throughout the LightFrame rather than just the booking confirmation page. In order to accomplish this, the UA code must be placed on the Dashboard using the built in Google Analytics tool.
If the submitter gives you the whole gtag, create a new analytics service with type Google Analytics, take the UA Code from the gtag and place it in the respective field.

Google Ads
Google Ads conversion codes are generated in the Google Ads Dashboard when the client creates a new conversion event. Google ads tracking requires two code snippets.
Google Site tag: This code needs to go on the dashboard as custom code as well on the head of their website. It is acceptable to have the client’s web dev add this to the website.

Event Snippet: This needs to go on the Dashboard alongside the gtag to fire on the confirmation page.
Be aware that the same gtag / GA account can have more than one ad campaign. There may be multiple event snippets with different send_to values.

Required queries:
Send_to: This designates the Google Ads ID and Conversion event ID. This should be provided by the client when they set up the conversion event. If it is not present, we send it back.
value:
booking.totalInDollars, add to snippet if not present.transaction_id:
booking.pk, add to snippet if not present.currency: This can be left hard coded as “USD’. If not in the US, change to
booking.currency.
If they are requesting queries we aren’t able to track, you can delete those queries and let the submitter know.
Note: If the client only supplied the event snippet, you can add the gtag by using the gtag; text expander to create the template. Paste the AW conversion ID (not the label) from the event snippet and insert it into the gtag template.
Sojern
Sojern pixel codes often come in documents with multiple codes. We work specifically with the conversion pixel. If a homepage pixel is provided, we will implement on the client’s site only if tier 3+, lower tiers will have to have their web dev implement it. Any other pixels can be ignored.
Inject the booking parameters in the event snippet. Constant variables like company location can be hard coded as a string. Check the client’s close lead to find their location if necessary. Any parameters that we do not have variables for may be removed.
In the following example, we would substitute variables for Product Name, Purchase Price, and Confirmation Number. The other variables can be removed. Make sure to inform the submitter if we removed any parameters. Place the filled out pixel on the Dashboard.

Google Tag Manager
Google Tag Manager is unique in that it manages multiple tags. Different pixels can be added to the GTM dash, and only one pixel is necessary to add. How information passes into GTM is entirely dependent on what pixels are loaded into it. We will add GTM to the dashboard, but we cannot support or troubleshoot any issues they may see.
Clients should will typically provide two pixels: one for the head and one for the body. Only the head tag is necessary to add to the dashboard, but add the body tag if provided. Depending on what they want to track, these tags go on the dash or on the website. Follow submitter instructions for where to put the pixels.

BE CAREFUL with pasted code from clients. Sometimes there is an extra character that gets added to the code and makes the script throw an error. Remove this before adding to the dash.

Facebook now has two different ad tracking technologies. Meta pixel and the Conversions API. Conversions API is the newer technology that shares first-party data from the server, while Meta Pixel is older and relies on the third-party cookies from web browsers. The standard and most effective tracking method is the conversions api, but both have built in functionality with FareHarbor.
In almost all cases, Facebook tracking should be done with the built in dashboard tool, and not through custom code. If a client is requesting a pixel be added to the dashboard, add it using the built in tool and let the submitter know.
Depending on what the submitter provided, we can implement either the Meta Pixel or Conversions API. If only the Pixel ID is added to the dashboard, it will be added as Meta Pixel. If the Pixel ID, conversion token, and source URL is added, it will be added as the conversions API.
When implementing Facebook tracking, the dash needs to have either just the Pixel ID, or the Pixel ID + conversion token + source URL. This information should all be provided through the submitter.
Note: More than one pixel ID can be added to the dashboard, but only one conversion API can be used per dashboard.

Bing / Microsoft
The Bing UET tag is typically straightforward. The submitter should provide you with the UET tag and a conversion tag. Inject the variables as necessary and add to the Dashboard.

Limitations of the FH product
Unfortunately the FareHarbor product functionality is limited. There are many setups the client may request that are not possible. The most common limitations we see are as follows:
We cannot track the origin of bookings made on FH.
- Exception being Google Ads that can track a customer’s session from the original ad into the LightFrame through cookies.
- This also may be possible through an API connection, but the submitter would have to check with the connectivity team.
Limited amount of variables in the booking object
- We are only able to send info based on what is available through the booking object.
- No customer info (names, phone number etc.) can be passed through custom code.
- View the booking object table to see what can be passed.
- The ability to add custom code is limited to FareHarbor employees.
- This is largely for security purposes. Potentially dangerous javascript could be added to the dashboard if access was given out freely.
Only one item can be tracked per booking.
- For cart setups with multiple items being sold at once, the booking object will report on only the first item in the cart. There is no way to pass through an array of all items in the customer’s cart.
Only HTML and therefore vanilla Javascript can be used in custom code section.
- No way to send tracking info through URL or cookies.
- There is a complex custom setup that can potentially accomplish this, but should only be considered for enterprise clients. Escalate to your team lead if something like this is being requested.
- Can’t track any activity within the LightFrame until the booking confirmation page.
- Exception being Google Analytics can track and report clicks within the LightFrame if using the built in tool on the Dashboard, but no other services can do this.
- Can’t track to a client’s Thank You page on their website.
- FareHarbor accomplishes the same functionality through custom code, therefore all pixels must be added to the Dashboard.
- We can redirect after booking to a Thank You page but will not accomplish anything related to tracking.
- More info down below.
- Tag trackers and Chrome extensions will likely not be able to detect the pixel.
- Since the booking confirmation page is within an iframe, the parent page will not register the pixel. This does not mean that the pixel is not working.
- The pixel, however, can be seen in the elements when inspecting the confirmation page with dev tools.
Testing on your demo dash
Before implementing the pixel on the client’s live dash, it is important to test it on your demo dash. This will ensure that the pixel runs and does not have any glaring issues. Be aware that even if no errors are thrown, it does not mean the pixel is working how the client intends. The pixel can run while also not passing the correct information.
Setting up your demo dash
It is recommended that you do a few things before testing any pixels on your demo dash. Create an item called “FareHarbor Test Booking”, this will ensure that when booking information is passed, it is clear to the client that it was a test.
Add a customer type to your demo dash that has no cost and apply it to your Test Booking item. This will ensure that you do not need to enter any payment information when completing your test booking. Create daily availabilities for this item.
To test on your demo dash:
- Navigate to the “analytics and tracking” menu in your demo dash.
- After adding any necessary variables, add the pixel as a custom code block.
- Open your test booking link in an incognito tab, apply the free Customer Type and complete the booking
- Look in your console to ensure there are no errors. Note that “Report Only” errors are ok, this is a simulated CORS error that is not actually occurring.
Troubleshooting Steps
If a client says that the pixel is not set up correctly or is not converting correctly, there are a few things that we can try:
Copy the code into a code editor before adding to the dashboard.
- When copying directly from Airtable or an email, certain characters (particularly quotation marks) can be incorrectly replaced.
Look at the pixel for glaring issues.
- Is a method being called that isn’t declared?
- Are there any missing characters like semicolons?
- Are the booking variables added correctly?
- Are the booking variables mistakenly being added as strings?
Test on your demo dash and check for potential errors
- Syntax errors should show up.
- Check to make sure it’s not calling a function that isn’t declared.
Make sure the LightFrame is working properly on their site
- For Google Analytics / Ads, the LightFrame is required in order to track a customer’s session from the website to the conversion pixel. If it is not working, it may incorrectly report conversion information.
Check the links on the website for hardcoded GA tags.
- GA tags should be added to the URL dynamically from the gtag on the client’s site. If they are hardcoded, conversion information will pass incorrectly.
Compare with similar pixels we have completed before.
- Check Airtable to see if we have seen this before?
- Is there anything we did originally or missing from the new pixel that might be necessary?
Check the pixels documentation.
- Google to see if you can find the documentation for this pixel. What pieces of code are required to make this code work? Make sure the client is not forgetting to include something.
Consider the order of the script.
- If an event snippet calls a function before it has been declared, it will not execute.
Consider combining pixels into one custom code.
- If a pixel and event snippet rely on each other to run, they need to be placed in the same custom code instance.
Have the submitter send the client the pixel exactly as it is set up on the dash. Ask them if they see any potential issues.
What format should the booking variables be returned?
- If the client is expecting an integer value, and it is returning a string, it will report incorrectly.
- booking.totalInDollars should be used for Integers, booking.total_in_dollars should be used for strings.
What exactly is the client expecting to see?
- Sometimes the client can be expecting to see information reported that is not possible. Have the submitter ask the client exactly what they are expecting to see. Check and make sure that what they are expecting is not on the list of limitations above
Talk to your team lead, you may have to tell the client we are unable to fix their issue.
Sending a Request Back
If you have made it through these steps and the client is still complaining, notify your team lead. We may have to tell them that there is nothing else we can do. It is not easy or expected that we can understand what a client’s pixel is trying to do, or how their backend is configured to interpret information. We are not marketing experts and there is only so much we can do with only the pixel they provided. If we have no documentation, have implemented it as they sent over, and checked the most common errors, there is nothing else we can do.
Return to URLs
Sometimes a client may request that the LightFrame redirect to a certain page upon successful booking. This is technically possible though very hacky and a security risk. Usually a client is requesting this in order to send conversion codes from their thank you page. Make sure the client understands that conversion info cannot be passed from the thank you page. The client can have other scripts run on the thank you page, but since the booking happens entirely within the Lightframe, the conversion pixel must go in the dashboard. If the client understands this and still wants the redirect, notify your team lead.
Identifiers
Identifiers are a feature in the dashboard that lets you reuse common pieces of code. By adding a single value to the identifiers field, it can be called in your custom code by using the identifier value. This is a very underutilized feature, but it works as follows.

For multiple values, you can also set identifiers up as a json object with key / value pairs. This can be called from your custom code using dot notation.

FAQs
The client already has a similar tag in the dashboard. Should I add the new pixel?
- If the pixel is completely identical, reach out to the submitter and let them know. If it is a pixel for the same service with a different ID, you can add it in addition. It is likely they are trying to report to more than one account.
The client failed to include a part of the pixel. What should I do?
- There are certain cases where we might be able to find it ourselves. If the missing piece is universal and does not have any account specific information, we can use old instances to find what needs to be added. Additionally, if the missing piece only needs an account number that we are already given, we can add it and substitute the account number. If the missing piece is completely unique, tell the submitter to request it from the client.
The client is complaining they don’t see the conversion pixel through their browser tag tracker.
- Because the conversion pixel is added to only the booking confirmation page of the LightFrame, it will not be detected by any browser tools. The browser tool only looks for tags on the parent document, where the conversion pixel does not exist. Ensure the client that the tag should still be firing as intended.