Learn how to install AI tools script on your website using one of three available options.
1. Open your Travelpayouts account and launch the AI tools tab.
2. On the top bar pick the Project where you want to install the script from the dropdown list and click I'm in. By default, the Projects are sorted by the date of creation.
Note: Only projects that have websites will be shown. If you don’t yet have a Project, you can follow these instructions in our Help Center to create it.
3. You can activate LinkSwitcher and Emerald during step 2. While these solutions won’t function until the script is installed, it’s important to click through and activate both LinkSwitcher and Emerald to unlock step 3: Install & Activate.
4. There are 3 methods to install the script. Choose one of them and follow the instructions from your Travelpayouts account. You can also use the instructions provided in this article below.
Installing via WordPress
-
Open your website’s WordPress admin dashboard. In the left pane, click Plugins, and then click Add New.
- Type "Head & Footer Code" in the search field.
-
Find the right plugin (same as in the picture below) and click the Install Now button. This plugin will help you apply the script to every page of your blog.
- Once the installation is completed, click Activate.
- Next, you will be brought to the list of Installed plugins. Find "Head & Footer Code" in the list and open its Settings.
-
Return to the AI tools tab in your Travelpayouts account and copy the script code.
Note that the script is unique for each Project. If you are planning to use AI tools in multiple Projects, you need to copy scripts for each of them separately. -
Paste the code in the Head & Footer plugin in the HEAD Code section.
- Scroll to the bottom of the page and click Save changes.
- If you are using the WP Rocket plugin, make sure to add the script to the list of exceptions by following these guidelines.
- Clear the cache of your website to get the script working.
-
Return to your Travelpayouts account and make sure that LinkSwitcher and Emerald are activated.
- Read more about solutions here:
Installing via Google Tag Manager
Before you can proceed with the installation, ensure that you have a Google Tag Manager account and have created a Tag Manager container in it. Follow the instructions in the official Google documentation to set them up.
- Make sure you have a Google Tag Manager account and a container created for your website. If you don’t have these set up yet, follow the instructions in the official Google documentation to complete these steps.
- Install a created Google Tag Manager container on the website where you plan to use AI tools. Use the instructions described here.
-
Open the created Tag Manager container and add a new tag. For more instructions, check Google documentation.
- Select Custom HTML as the tag type.
-
Return to the AI tools tab in your Travelpayouts account and copy the script code.
Note that the script is unique for each Project. If you are planning to use AI tools in multiple Projects, you need to copy scripts for each of them separately. -
Paste the code in the HTML field of the New tag form.
-
Select All Pages in the Triggers section of the Tag.
- Click Save to complete the set up of the Tag.
-
Click Submit in the upper-right corner to publish the changes made in your Google Tag Manager. This step is crucial.
-
In the window that opens, specify the version name (e.g., "AI tools Script Setup"). Click Publish to apply settings to your website.
- If you are using the WP Rocket plugin, make sure to add LinkSwitcher to the list of exceptions by following these guidelines.
-
Return to your Travelpayouts account and make sure that LinkSwitcher and Emerald are activated.
- Read more about solutions here:
Manual installation
-
Select Manual installation on the AI tools tab:
-
Copy the script code.
Note that the script is unique for each Project. If you are planning to use AI tools in multiple Projects, you need to copy scripts for each of them separately. -
Add the code in the tag ‘<head>’ on all your pages. If you have a separate HTML file containing a head tag, just paste the code there.
- If you are using the WP Rocket plugin, make sure to add LinkSwitcher to the list of exceptions by following these guidelines.
-
Return to your Travelpayouts account and make sure that LinkSwitcher and Emerald are activated.
- Read more about solutions here:
WP Rocket plugin: How to add scripts to all JS optimizations
If you are using the WP Rocket plugin, you need to add Travelpayouts AI tools script to the list of exceptions. We have added detailed instructions below. If you are using any other plugins that cache js-scripts, please contact our support team.
- Open the WP Rocket plugin settings.
-
Navigate to the File Optimization tab.
-
If in the Javascript Files section, you don’t have any checkboxes active, you don’t need to do anything. If you have active checkboxes, please continue with the next point number 4.
- Copy the script code from your Travelpayouts account again.
-
You only need to take the domain from the code. You can find it here:
-
Insert the domain from the code to all Excluded JavaScript Files fields in the Javascript Files section of the WP Rocket plugin:
- Click Save changes at the bottom of the page.
After installation
Once the script is installed and starts to work the overview of the AI tools page will change to show only the settings of the tools and to indicate what tools work.
Where to find the script code after installation?
If you have already installed the script on your website you are able to check and copy the script code.
- Launch the AI tools page in your Travelpayouts account.
- Selecting the Project where the script is installed.
-
Click on the script button on the Emerald or LinkSwitcher page.
- Check the script code in the pop-up window.
I already installed the script on one website, how can I install it on another one?
If you have also installed the script on one of your projects and now want to use AI tools on another website, please keep the following in mind::
- The script code is unique for each website, which means you cannot copy the same script you have already used. You need to open the AI tools page in your Travelpayouts account and select the Project you created for the URL of the new website.
- Click the Get script button.
- Copy the script code and install it on your website using one of the options mentioned in this article. You can already turn on the tools at this step.