Follow the guide below for the platform that your landing pages are hosted on. You only need to do this one time. Add the Tofu script to the <head> section for all landing pages. This is typically found at the site or account settings.
It is strongly recommended to add the script as early as possible in the <head> as opposed to the <body> section or below to avoid flickering for your dynamic landing pages.
Tofu Script
Copy this to the header:
<script id="tofu_runner" src="https://public.api.tofuhq.com/tofu_embed.js"></script>
Note about Google Tag Manager
While the Tofu script can be added through Google Tag Manager, we do not recommend this setup. GTM introduces an extra step that delays the script from running, which can slow down content loading and sometimes cause a visible flicker on the page. For best performance, we suggest placing the Tofu script directly on your site instead.
Platform guides
WordPress
HubSpot
Add global custom code via HubSpot settings:
- Log into your HubSpot account.
- In the main navigation bar, click the gear icon to go to Settings.
- In the left sidebar menu, navigate to Website → Pages (under “Tools”).
- Click the “Templates” tab.
- Scroll to the Site Header HTML or Footer HTML section.
- Paste the Tofu script from above into the header.
- Click Save at the bottom.
This will inject the code into all HubSpot-hosted pages on your domain (including landing pages, blog, etc.).
External reference: Add code to the head or footer HTML of HubSpot content — see the section Add code snippets to all content hosted on a specific domain.
Marketo
- Edit landing page title and metadata (Adobe Experience League)
- This needs to be done to each landing page you plan to personalize
Webflow
Unbounce
GetResponse
Framer
Contentful
How it works
The Tofu code snippet makes an API call to our backend servers to fetch and replace the text copy for a personalized landing page. This API call is only made when a user visits a personalized version of the landing page based on the tofu_slug query parameter. For normal visits to the page, no calls are made. Our code does not rely on cookies, hence can work in any browser environment (e.g. incognito, scenario where user does not accept cookies to be stored, etc.). All other existing trackers or analytics on the page are not affected by our code snippet and will operate as intended.