- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
02-25-2015 07:29 AM - last edited on 10-05-2015 11:22 AM by kathleen_jo
I am looking into how event tracking can be done best and found out that when I call utag.link/view, the parameters passed are persisted in utag.data. I 'm not sure if that is intentional but I actually need the following.
when sending an event I ONLY want to send the variables that have been added into the method call and NOT the variables in the UDO also.
Currenlty when I call utag.link({event:'foo'}) the tags get fired correctly (as the mapping of the event parameter has been configured) but after this method call I can see in the utag.data object the event variable added. When issuing other calls without the event parameter I see that the 'old' event variable is also send. Is Tealium designed to add variables from these method calls to the utag.data object or should that not be the case?
02-25-2015 09:40 AM
02-26-2015 06:29 AM - last edited on 10-05-2015 11:22 AM by kathleen_jo
I do not get the same result, see my test results below:
Setup
-------------------
-new profile
-html page with code directly from 'code center'
-1 tag added, Tealium custom container,loaded on all pages, where send function does only log the values of the a and b parameters and the mapped data object:
//tealium universal tag - utag.loader ut4.37.##UTVERSION##
u.send = function(a, b) {
console.log('Start send');
console.log('Var a:',a);
console.log('Var b:',b);
... mapping code from Tealium...
console.log('U data:',u.data);
-mapped three UDO variables: event --> ev, event_location-->event_location, event_detail-->event_detail;
Use case 1: Page load
-------------------------------
> utag.data = contains standard utag variables generated by tealium
in tag: console.log(a) = 'view'
in tag: console.log(b) = same as utag.data
OK = Expected result
Test 1: manual utag.link with mapped event parameter (event is mapped to ev)
----------------------------------
> utag.link({event:'foo'});
in tag: console.log(a) = 'link'
in tag:console.log(b) = same as utag.data + variable event:'foobar'
in tag: eventual mapped data = ev:'foobar'
Mapping is ok BUT
> utag.data = standard utag.data + variable event:'foobar' so basically the same as variable b
NOK == not expected this result
Expected result is that utag.data does not contain the event variable.
Using any other parameter exhibits the same behavior:
utag.view({notmappedparam:'should not be there'}), the variable notmappedparam is afterwards also in utag.data AND utag_data plus the event parameter is now set to view.
02-26-2015 07:12 AM - last edited on 10-05-2015 11:23 AM by kathleen_jo
when digging into the code I've seen the following in utag.js(line 707+708):
else if(utag.cfg.load_rules_ajax){
// right now, load rules use utag.data (replace items in utag.data with items in b)
if I set utag.cfg.load_rules_ajax to false the utag.data is kept intact but I am not sure what the side effects of this setting will have so I am not sure if this is a solution
02-26-2015 06:28 PM
02-27-2015 07:51 AM - last edited on 10-05-2015 11:23 AM by kathleen_jo
This is most likely the result of the loadrule code being re-evaluated. At present, the data that is passed in has to be added to the utag.data object to allow for the re-evaluation. There is an update currently being worked on to stop this from happening and instead will allow the data object passed in to be sent to the loadrules re-evaluation function, leaving the utag.data object as it was.
Adrian
05-13-2016 03:29 PM
Hello - this is an interesting post - what's the news on the update mentioned by @adrian_browning ? I have a possibly similar issue I need to resolve.
Thanks -
MitchellT
05-16-2016 01:00 AM
The update that I was referring to has now been released.
And is available in the latest utag version (v4.40).
https://community.tealiumiq.com/t5/uTag/How-do-I-upgrade-to-the-latest-utag-js/ta-p/5042
Adrian
Copyright All Rights Reserved © 2008-2023