overriding utag_data values within the dev google chrome console ?

Bronze Contributor
Bronze Contributor

Hi the Tealium community,

 

I'm new to the Tealium Community as well i've some basic knowledge about JavaScript. So for this newbie question, I would like to know if there is a way to do like a datalayer.push function or equivalent to override the values implemented by my dev into the website's datalayer.

My idea is to do 2 things:

* to show the dev what is the expected value for a specific variable directly 'live' even if i don't have any access to the CMS ==> like an overriding of the value for the variable

* to get the possibility to trigger some tags or some events (e.g via the tealium IQ extensions) directly from the dev  google chrome console 

 

I was able to do it previously with Google analytics with some websites which were using Google tag manager.

Because i don't have access to the CMS, i should only use the Google dev console

Many thanks for your help

Sébastien

5 REPLIES 5

overriding utag_data values within the dev google chrome console ?

Gold Contributor
Gold Contributor

Hi @spujade ,

You can add a new custom extension of type "setdata values" in there you can select the data layer you want to modify and pass the expected value and set the scope to all tags you shold be fine and be able to see the overrided values in the data layer. 

 

VR

overriding utag_data values within the dev google chrome console ?

Bronze Contributor
Bronze Contributor

Hi @vinayreddy,

 

Can you please provide an example code ? 

Because, if my understanding is correct, i need to create this new custom extension within Tealium IQ, whereas i would like to change my values on the fly using my google chrome debugger console ?

Thanks in advance for your tips

All the best,

Sébastien

overriding utag_data values within the dev google chrome console ?

Bronze Contributor
Bronze Contributor

Hi @vinayreddy,

James Lingham from the Tealium's support team provide me the answer.

 

You should use your console & rewrite the datalayer 

// example of rewriting the datalayer driectly within the google debugger dev ==> 'console' tab

utag_data = {"site_region":"test_test","site_currency":"EUR","page_name":"Tealium test","page_type":"test_test","tealium_event":"page_view","country_name":"France_test","country_code":"FR_test"};
rewriting the datalayer with utag_data.jpg

 

 

 

 

 

 

 

 

But if you like to keep it accross your session & when you"re refreshing the page; you need to enable 

"persistent" + "enable local Overrides"

As a result you will be able to acess to the utag.js script in editing environnement on which you changing the tealium's datalayer and values.

After, you can refresh the pages and the values will be keeping the new values you defined for the datalayer's variables.

Hope my comments can help the community,

Regards, Sébastien

overriding utag_data values within the dev google chrome console ?

Silver Contributor
Silver Contributor
this doesnt work on my end. can someone please tell if I am doing something wrong.

utag_data["site_section"]
"Homepage"
utag_data = {"site_region":"test_test"};
{site_region: "test_test"}
"persistent" + "enable local Overrides"
"persistentenable local Overrides"

As soon as I refresh the page I see the value "homepage" instead of test_test

overriding utag_data values within the dev google chrome console ?

Employee Emeritus

@jayvora place a line break on the first line inside utag.js file.

When it breaks, in the console check for contents of utag_data

If it is missing, create it. Then modify the data directly. Example:

utag_data = utag_data || {};
utag_data.
site_region = "test";

Then unpause the breakpoint and let it run through.

Hope that helps!

Public