For teams that want pixel-level control, a widget can carry your own custom CSS and custom JavaScript that fires at key moments in the booking flow. Because this involves running your own code, it's an account-manager feature — reach out to your TripWorks account manager to have it enabled and edited on your widget.
In this article
Custom CSS
Add CSS to restyle the widget so it matches your site — fonts, colors, spacing, buttons. Your styles apply on top of the widget's defaults.
Custom JavaScript at each step
You can attach JavaScript that runs at four points in the booking journey:
- On load — when the widget first appears.
- On view item — when a guest opens an activity.
- On add to cart — when they add something to their booking.
- On conversion — when a booking is completed.
Each hook receives a data object about what just happened — including the confirmation code, total, subtotal, currency, the widget's name and ID, the marketing UTM values, and the landing/referral URL. That makes it easy to fire your own analytics or advertising events at exactly the right moment.
If you use Google Tag Manager, you may not need custom code at all: TripWorks automatically pushes booking events (widget load, view item, add to cart, purchase) to your page's dataLayer for GTM to pick up.
Where you can use formatting and HTML
Custom CSS and JavaScript apply to the widget as a whole. For the text inside your listings, policies, and messages, many fields use a rich-text editor where you can format text, add links, and switch to an HTML view to edit the HTML directly. No account manager is needed for these.
- Activity short summary and detailed description (the activity's Descriptions tab): headings, bold, italic, lists, links, and HTML view. Links open in a new tab on your booking page.
- Add-on descriptions (the activity's Add-ons tab): headings, bold, italic, lists, links, and HTML view. Guests see this at checkout.
- Custom field descriptions (in Custom Fields): headings, bold, italic, lists, links, and HTML view. Shown below the question at checkout.
- Receipt footer text on an activity: headings, bold, italic, lists, links, and HTML view.
- Cancellation policy, confirmation notes, self-transportation notes, and gift card notes (the Policies tab of Company Info & Branding, and the same fields on an activity's Policies tab): headings, bold, italic, lists, links, and HTML view. See Set your cancellation policy and account-wide notes.
- Email message templates: the fullest editor, with formatting, links, uploaded images, ready-made blocks, and HTML view. See Create, edit & manage message templates.
- Waiver text: headings, bold, italic, lists, tables, alignment, and HTML view. There's no link button, so add links in the HTML view. See Multiple waivers, additional signers & bulk actions.
Some fields are plain text only: the receipt legal footer on your Policies tab, the kiosk alternate description, add-on titles, and SMS message text (links in a text message always show as the full web address).
Only the email message template editor has an image upload. To show a photo with your policies or activity details, add it to an email template, or host it on your website and link to it.
Frequently asked questions
Is custom code available on my account?
Custom CSS/JavaScript is an account-manager feature because it runs your own code in the widget. Contact your TripWorks account manager to enable it and add your code.
What information does the conversion hook receive?
A data object with the confirmation code, totals and currency, the widget name/ID, the UTM source/medium/campaign/term/content, and the landing and referral URLs — enough to attribute and report the booking in your own tools.
Do I need custom JavaScript to track conversions?
Usually not. TripWorks fires GA4, Google Ads, and pixel conversions for you when they're set up, and pushes events to your GTM dataLayer. Custom JS is for cases those don't cover.
Can I replace the generic background image on the booking widget?
Yes, through custom CSS — there's no upload field for it, so it's set with a CSS rule targeting the widget's background, the same account-manager feature described above. Ask your TripWorks account manager to swap it for an image of your own activity.
Where can I use custom HTML in TripWorks?
Most long-text fields have a rich-text editor with an HTML view: activity summaries and descriptions, add-on descriptions, custom field descriptions, activity receipt footer text, your cancellation policy and notes, email message templates, and waiver text. Open the field, switch the editor to its HTML view, and edit the HTML directly. Custom CSS and JavaScript for the booking widget itself is a separate, account-manager feature described in this article.
Which fields don't accept HTML?
The receipt legal footer on your Policies tab, the kiosk alternate description, add-on titles, and the SMS version of a message template are plain text. In a text message, a link always shows as the full web address because text messages can't carry formatted links.
Can I add images to an activity description, add-on, or policy?
Those fields have no image upload. Activity photos belong on the activity's Photos tab, and your booking page shows them on its own. For anything else, such as a parking map, add the image to an email message template using its image button, or host it on your website and link to it from the field.
Related
Built for attractions, tours & activities
Make it unmistakably yours
See how attractions, tours, and activities tailor their booking widget to their brand on TripWorks. Book a demo and make the switch.