Want to change SiteCatalyst Report Suite ID or Google Analytics Account ID based on the Tealium environment you're using? Read this article!
You want to change the value of a data source you are mapping to a tag based on the environment it is in. For example, you want to change the Account ID sent to Google Analytics based on the environment the tag is pushed to.
Create a 'Set Data Values' extension and set 'tealium_environment' to equal the following JS Code:
This extension will pull in the environment that Tealium is running in from the page in lower case:
e.g. if you are in the 'prod' environment then 'tealium_environment' will be set to 'prod'
In this example, you are setting different Google Analytics Account IDs based on the environment:
Note : Ensure this runs AFTER the extension setting 'tealium_environment'. Otherwise, it won't have a value to look up against!
For this example, map the "ga_account_id_standard" Data Source to the "Account" destination in Google Analytics.
You're done! Everything should be working for you now!
This method eliminates the need to create and set the value of “tealium_environment” data source. Instead, you will make use of “ut.env”, which is the built-in variable for publish environment and only available to utag v4.36 and above. Here's how to go about it: