LinkSwitcher: Turn links on your website into Travelpayouts affiliate links

If you work directly with travel brands and already have links to their websites on your blog, you can easily convert them to Travelpayouts affiliate links using the Travelpayouts LinkSwitcher. This includes links from the brand's direct affiliate programs, links from affiliate networks like CJ and AWIN, and regular links to the brand's websites copied directly from their site and shared on your blog for your readers.

With this tool, you will continue receiving rewards for all bookings made via your affiliate links, but also gain additional benefits, like monetization of regular, non-affiliate links, access to all major travel brand programs all in one place, automatic and timely payouts, and detailed performance stats. All of this can be conveniently managed in one place: your Travelpayouts dashboard.

Important! LinkSwitcher can only switch links. Other tools, such as widgets, banners, etc., will not be affected.

Note! If you were using Money Script, you need to uninstall it from your website to start using LinkSwitcher.

What is LinkSwitcher?

LinkSwitcher is a piece of JavaScript code that can be added to a site. This tool turns regular links to travel brands and affiliate links from direct travel brands programs into Travelpayouts affiliate links. Such links include a unique ID, which helps to attribute bookings to your account and allows you to receive rewards via our platform.

LinkSwitcher streamlines the process of replacing regular links with affiliate ones, saving you time for more important things like travel, blogging, and growth. With a user-friendly setup, it ensures simplicity and safety, with the option to revert all changes at any time.

What types of links does LinkSwicher convert?

  • Links from the brand's direct affiliate programs (you get these links if you are signed up with direct affiliate programs of travel brands).
  • Links from affiliate networks (СJ, AWIN, Partnerize, Avant, Skimlinks, ShareASale, CommisionFactory, and Admitad).
  • Regular links to the brand's websites (copied directly from the brand's site and shared in your blog).

Additionally, LinkSwitcher helps you find broken travel links across your website. With our tool, you can easily identify invalid links in your content and replace them with working links making sure that your articles stay up-to-date and valuable for your readers. Read more here.

What do I need to start using LinkSwitcher?

To use the LinkSwitcher, you must have a website and access to its code editor. You also need to complete the following steps before starting with the LinkSwitcher:

1. Sign up for Travelpayouts if you have not yet done so. 

2. Next, you need to create a Project in your Travelpayouts account. The Project contains information about the website where you want to use Travelpayouts affiliate links. You can follow these instructions in our Help Center to create a Project. Your Project can include multiple websites where you can install LinkSwitcher.

3. Go to the program’s catalog and connect to the programs from brands, which links you want to switch into Travelpayouts affiliate links.
Note! All of the brands in the catalog are supported by LinkSwitcher with only 3 exceptions (Cheapoair, Indrive, and Ticketnetwork).

4. Open the profile page of the program you want to connect to in your Travelpayouts account and click Connect to program.
Note! Some programs require the brand's approval to connect. This means that your Project will be reviewed to ensure that it complies with the program's terms and conditions. You can find more information in the How to connect to a program article.

5. Once you are connected to a program — you will receive an email confirming that. Now you can install the LinkSwitcher on your website.

Important! If you are using Money Script, you need to uninstall it from your website to start using LinkSwitcher. This includes Money Script enabled via the Travelpayouts WordPress plugin.

How to install LinkSwitcher on your website

1. Open your Travelpayouts account and launch the LinkSwitcher tab.

2. Select the Project where you want to install LinkSwitcher from the Projects with a website section. If you don’t yet have a Project, you can follow these instructions in our Help Center to create it.

3. If you are already using Travelpayouts Emerald on the given Project, you can activate LinkSwitcher by simply turning the Switched-Off toggle ON. No need to complete any additional installations.

4. If you are not yet using Emerald on the given Project, you need to install the script on the website. To do this click the How to install button.

5. 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

Installing via WordPress

  1. Open your website’s WordPress admin dashboard. In the left pane, click Plugins, and then click Add New.
  2. Type "Head & Footer Code" in the search field.
  3. Find the right plugin (same as in the picture below) and click the Install Now button. This plugin will help you apply LinkSwitcher to every page of your blog.
  4. Once the installation is completed, click Activate.
  5. Next, you will be brought to the list of Installed plugins. Find "Head & Footer Code" in the list and open its Settings.
  6. Return to the LinkSwitcher tab in your Travelpayouts account and click Show script.

    Note that the script is unique for each Project. If you are planning to use LinkSwitcher in multiple Projects, you need to copy scripts for each of them separately.
  7. Click Show script.
  8. Copy the script code.
  9. Paste the code in the Head & Footer plugin in the HEAD Code section.
  10. Scroll to the bottom of the page and click Save changes.
  11. If you are using the WP Rocket plugin, make sure to add LinkSwitcher to the list of exceptions by following these guidelines. 
  12. Continue with LinkSwitcher Settings.

Installing via Google Tag Manager

  1. Open Google Tag Manager and add a new tag. For more instructions, check Google documentation.
  2. Select Custom HTML as the tag type.
  3. Return to the LinkSwitcher tab in your Travelpayouts account and click Show script.

    Note that the script is unique for each Project. If you are planning to use LinkSwitcher in multiple Projects, you need to copy scripts for each of them separately.
  4. Click Show script.
  5. Copy the script code.
  6. Paste the code in the HTML field of the New tag form.
  1. Select All Pages in the triggers section.
  2. Save changes.
  3. If you are using the WP Rocket plugin, make sure to add LinkSwitcher to the list of exceptions by following these guidelines. 
  4. Continue with LinkSwitcher Settings.

Manual Code Setup

  1. Open the LinkSwitcher tab in your Travelpayouts account and click Show script.

    Note that the script is unique for each Project. If you are planning to use LinkSwitcher in multiple Projects, you need to copy scripts for each of them separately.
  2. Click Show script.
  3. Copy the script code.
  4. 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.
  5. If you are using the WP Rocket plugin, make sure to add LinkSwitcher to the list of exceptions by following these guidelines. 
  6. Continue with LinkSwitcher Settings.

WP Rocket plugin: How to add Emerald to all JS optimizations

If you are using the WP Rocket plugin, you need to add LinkSwitcher 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.

  1. Open the WP Rocket plugin settings.
  2. Navigate to the File Optimization tab.
  3. 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.
  4. Copy the LinkSwitcher code from your Travelpayouts account again.
  5. You only need to take the domain from the code. You can find it here:
  6. Insert the domain from the code to all Excluded JavaScript Files fields in the Javascript Files section of the WP Rocket plugin:

  7. Click Save changes at the bottom of the page.

LinkSwitcher Settings

Once you have completed the installation, you can change the default settings of the LinkSwitcher in your Travelpayouts Account.

Note: Don’t forget to click Apply changes if you want to save any changes made to the setup.

Review invalid links

LinkSwitcher helps you find broken links across your website. Using this feature, you can easily identify all invalid links in your content that lead to 404 and 400 errors. You can then delete or replace them with working links making sure that your articles stay up-to-date and valuable for your readers.
LinkSwitcher script scans your content for invalid links every 24 hours.
This means that after you replace broken links, they won't immediately disappear from the list in your Travelpayouts account.

LinkSwitcher checks the following types of links for invalidity:

  • Travelpayouts affiliate links
  • Affiliate links from the brand's direct affiliate programs
  • Affiliate links from other affiliate networks
  • Regular links to the travel brand's websites (for example to Booking.com)

To see the list of invalid links click the Review links button.

Note! If the button is not active, that means you don’t have any broken links.
The page with the list of all invalid links and pages where they are located will be shown. You can easily open the page or copy an invalid link to easily find and replace it

Note! After you replace links, you must wait 24 hours before the list of broken links on the LinkSwitcher page is updated.

Exclude specific pages

If you have some specific pages on your website where you don’t want LinkSwitcher to switch the links, simply add their URLs in this section. 

1. Click the View pages button.

2. Add the URLs of the needed pages. The URLs should be full and include the domain.

3. Save changes.
You will be able to remove pages from the list at any time.

Select the brands

Here you can select specific brands whose links you want to convert with LinkSwitcher. Adding a brand to the list means that all links from the brand's direct affiliate program as well as the regular non-affiliate links will be turned into Travelpayouts affiliate links. You can only select brands if you have connected to their programs in the Travelpayouts program catalog.

By default, all brands that you’re connected to using given projects will be automatically activated in the list.

You can also change the following settings:

  • Switch from affiliate networks to Travelpayouts — this setup allows you to automatically switch links from other affiliate networks (currently СJ, AWIN, Partnerize, Avant, Skimlinks, ShareASale, CommisionFactory и Admitad) into Travelpayouts affiliate links. 
  • Add new brands automatically — this setup ensures that every time you connect to a new program of the travel brand in the Travelpayouts program catalog, it will automatically appear in the list above. That means that the script will automatically process your links to this brand (both the existing ones and the ones you’ll be adding in the future).

Next steps after installation and setup

After you’re done with the installation and setup steps, open any page on your website with the installed script. This will speed up the installation process. 

The Switched on indicator will automatically become active as soon as LinkSwitcher starts working on your website and you will see Installed below the Project name:

Once LinkSwitcher is turned on, it will automatically switch the links from all the brands that you are connected to on Travelpayouts. You will be able to see all clicks and bookings made via your Travelpayouts links in the Reports section of your account. For more details, check out the Affiliate program summary article.

How to check if the LinkSwitcher is installed correctly?

You can check whether LinkSwitcher is installed and working properly on the given page. To do this:

1. Launch the developer console in your browser. For example, in Google Chrome you should open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools -> Developer Tools

2. If the LinkSwitcher script is successfully installed on the page, you will see the following logs in the console:

where:

  • [tp] linkswitcher init means that the script was inserted into the page and started executing.
  • [tp] linkswitcher convert links means that the script sent a request to convert links.

FAQ about LinkSwitcher

How to turn LinkSwitcher off?

To turn off LinkSwitcher on one of your sites, open the Project tab. where this site is listed, on the LinkSwitcher page in your Travelpayouts account, and click the Switched on toggle to deactivate it.

I am not working with the brand’s direct affiliate program, but I still have some links that I manually placed in my articles. Will LinkSwitcher help convert them into Travelpayouts affiliate links?

Yes, LinkSwitcher will convert such links as well. 

I already joined the brand’s direct affiliate program on their site. How can I add this brand’s program on Travelpayouts without requesting to connect?

To work with any brand via Travelpayouts, you need to connect to their program within our platform separately. So you can’t skip this step even if you previously joined the brand’s program directly on its website.

I joined the Booking.com direct affiliate program before I joined Travelpayouts. Do I need to delete my Booking.com account and re-apply through TP to have all my data in one place?

You can use both accounts, as it’s in line with the terms provided by both Booking.com and Travelpayouts. Therefore, there’s no need to delete your Booking.com account to start working with Travelpayouts. This also applies to any other brands.

Can I transfer my statistics from the direct program to Travelpayouts and have all the history there?

Unfortunately, there's no possibility to transfer and merge statistics on your performance from the direct affiliate program into your Travelpayouts account. As long as these accounts can't be connected in any way, the statistics in your Travelpayouts account will be collected separately.

Can I apply for the brand’s program in Travelpayouts if I was canceled in their direct affiliate program? 

Sure, but you still need to send a request to connect to a program via Travelpayouts. To do this, you need to create a Project in your Travelpayouts account and make sure to specify all the details about your website in it. Please note that some brands (e.g. Booking.com) provide rather strict requirements for our partners’ projects when it comes to approval. It’s important that your website is a travel-related content project updated on a regular basis.

Please note that if your request to connect to the direct affiliate program was declined, and you received a detailed explanation, you still need to bring your website in compliance with the requirements provided by the brand. After doing so, feel free to apply for the program within the Travelpayouts platform.

Where can I check the statistics for the Travelpayouts affiliate links? 

Once LinkSwitcher converts the links, you will be able to check impressions, views, and clicks using the Reports section in your Travelpayouts account. You can filter the stats by Project, which will allow you to see how well the links are performing on each of your websites where LinkSwitcher is enabled.

What affiliate networks' links does LinkSwitcher convert?

  • СJ
  • AWIN
  • Partnerize
  • Avant
  • Skimlinks
  • ShareASale
  • CommisionFactory
  • Admitad

Does LinkSwitcher add attributes to links?

Yes, LinkSwitcher adds the following attributes: noopener, nofollow, sponsored