- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-14-2016 12:34 PM
In the Release notes
https://community.tealiumiq.com/t5/uTag/utag-js-version-4-40-and-4-41-Release-Notes/ta-p/12946
there is this paragraph:
"Previously, items in current data layer passed to utag.link/view were merged into the utag.data global object. This was required to re-evaluate load rules for each utag.link/view call. The utag.js 4.40 template takes advantage of a publish engine update so that this is no longer required. In version 4.40, the utag.data global object will not be updated with each utag.link or utag.view call."
Then there is this:
"IMPORTANT: You may use the following JS Extension to test for backwards compatibility with v4.39 behavior before updating to v4.40.
// JS Extension scoped to "Before Load Rules"
utag.ut.merge( b, utag.data, 0 );
utag.ut.merge( utag.data, b ,1 );
"
I added this code. How will it help me in veriyfing whether I can update or not?
Solved! Go to Solution.
07-14-2016 12:55 PM
(How can I edit my question?)
Also here a question to make sure I understand the consequences of such an update:
Right now:
1. page loads and fills utag.data with myvar = "hund" - >utag.data['myvar'] = "hund". Tags to fire when myvar = "hund" fire.
2. On the same page, utag.link({"myvar":"katze"}) fires. -> utag.data['myvar'] = "katze" . Tags fire if they are configured to fire when myvar = "katze". Tags that are configured to fire when myvar = "hund" won't fire
3. Another utag.link call fires and sets the previously undefined "hisvar" to "maus". utag.data['hisvar'] = "maus". Tags fire if they are configured to fire when hisvar = "maus" OR when myvar = "katze"
After v4.40:
1. same
2. utag.data['myvar'] remains "hund". Tage to fire when myvar = "katze" won't fire. Tags to fire when myvar = "hund" fire again.
3. Same as 2.
07-15-2016 02:32 AM
Hi @loldenburg
Let me start of by clarifying what is happening.
In utag v4.39 and below data all data was merged onto the main utag.data object due to the need by the load rules.
v4.40 and above, this is no longer the case. utag.data, will be from the inital page view call / or an explicit additions you might have done.
What the code snippet does, is allow utag v.4.40+ to act like it previously did. So all data sent on a utag.view/link or track call will be merged into the utag.data object.
You only need to add this is you want to keep that same functionality.
utag v4.39 and below the data would look like: |
utag v4.40 and above the data would look like: |
---|---|
//Inital page view |
//Inital page view |
Now if a view/link or track call happens: utag.link({myvar : 'katze'}); |
Now if a view/link or track call happens: utag.link({myvar : 'katze'}); |
Now if another event happens: utag.link({hisvar : 'maus'}); // This will update the |
Now if another event happens: utag.link({hisvar : 'maus'}); // This will update the |
Hopefully this helps explain everything.
Adrian
07-15-2016 02:41 AM
07-15-2016 02:51 AM
"Passed in Object data" is the data that was sent through on the utag.view/link call.
A rule with hisvar = "maus"
will fire indeed still fire with or with out the extra lines of code.
Now if you still wanted to fire the rule myvar = 'katze'
on the link request in version 4.40, you would need to add the merge lines from above to the first All Tags Scoped Extension.
Adrian
Copyright All Rights Reserved © 2008-2023