This article describes the methods available to switch the publish environment of an installed Universal Tag (utag.js) file.

In this article:

Table of Contents Placeholder

How it Works

When you want to test changes on a particular site, but do not have access to the change the installed utag.js file, you can switch from the publish environment to another environment to test your changes. Switching environments is a safe way to test changes on your production site without publishing to the Prod environment.

There are three (3) methods that can be used to switch environments:

  • Use Web Companion
  • Use the Tealium Tools Environment Switcher
  • Place an Environment Cookie

Web Companion

The Web Companion method provides an interface with buttons that allow you to quickly view one of the default environments on a page.

Use the following steps to change environments using Web Companion:

  1. Launch Web Companion.
    The Target Environment section displays the current environment in blue and the coded environment with the orange border.
    Example: On your production site, it will look like this:
  2. To change which environment gets loaded on the page, click Dev or QA and then click Refresh Page.
    and the page will refresh with the newly selected environment.
    Example: If you click QA, refresh the page, and then reopen Web Companion, you will see the following:

    The switched environment is only valid for your local session. Your production site is not affected.

Tealium Tool: Environment Switcher

When you launch the Environment Switcher, the current account and profile detected on the page displays, along with configuration tabs that allow you to adjust the switcher according to your input.

Once you have the Environment Switcher available in Tealium Tools, use the following steps to launch it:

  1. Click the Tealium Tools icon in the upper right of the screen.
  2. Click the Home tab.
  3. Click Environment Switcher.
    Tealium Tools_Browser Extensions.jpg
    The Environment Switcher configuration screen displays a set of configuration tabs.
  4. Follow the instructions outlined in the Environment Switcher article to configure the settings on each tab as desired.

Place an Environment Cookie

You can also change the environment by placing an environment cookie.

Use the following steps to place an environment cookie:

  1. Open your browser console.
  2. Use the following command to place a cookie:
    document.cookie = "utag_env_ACCOUNT_PROFILE=// ACCOUNT/PROFILE/ENV/utag.js; path=/;";

    In the command line example, replace the variables as follows:

    • ACCOUNT – Replace with your Tealium iQ account name
    • PROFILE – Replace with your Tealium iQ profile name
    • ENV – Replace with the environment to load (dev, qa, or "custom")
    • YOURSITE – Replace with the domain name for your site
  3. After creating the cookie, refresh your browser to load the new environment.
Tags (2)