Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of Tealium's utag.view and/or utag.link for dynamically loaded elements

This may be a long shot but I'm looking for someone who has worked with the Tealium UDO (Universal Data Object). I have a search page with a Google Search Appliance, my utag_data object in the data layer that looks like this:

var utag_data = {
   "country":"US",
   "language":"EN",
   "search_keywords": "blahblah",
   "search_results": "0"
}

The problem here is the search_results property has not had enough time to wait for the real results number to load so it is defaulting to 0 instead of the real number 1200. I've read Tealium's documentation around the utag.view() and utag.link() and want to use one of these to update the search_results tag. I tried:

utag.link({'search_results':'1200'}); 

and

utag.view(utag_data,null,[12]); 

where 12 is the UID of the tag in Tealium but when using Omnibug in firefox I'm not seeing any updated values, but it is sending the click event to AT Internet.

Does anyone have any experience with this? Thank you in advance

like image 493
MannfromReno Avatar asked Jan 16 '15 17:01

MannfromReno


1 Answers

You can either wait to call the main utag.js Tealium script, or send along another data point using utag.link or utag.view. It is not possible to "update" the initial utag_data object once sent.

These methods are used to handle sending dynamic events/data. See additional discussion on the Tealium blog at ajax tracking.. when urls no longer change

From utag.link() and utag.view() on Tealium Learning

Syntax

The link and view methods allow you to pass three different parameters:

  • parameter 1: a JSON object

    utag.view({'search_results':'1200'});

  • parameter 2: a callback function (optional, may be set to null)

  • parameter 3: an array of Tags (optional: if used, these are the only Tags that will fire)

    utag.link( {'search_results':'1200'}, function(){alert("Only fired tag 12 with this call");}, [12] );

Notes:

  • The utag_data object declared on initial page landing is not re-purposed with these calls. If data from the initial page landing needs to be used it will need to be re-declared and passed again in the method call. For example, if language:"en" was passed on page landing, if language is needed for a tag fired by a utag method call then language will need to be passed again.
  • utag.view() calls should not be called on initial page load - they should only exist in the dynamic content loaded within the page.
  • Global and Tag-scoped Extensions are executed during these calls. Pre-loader and DOM Ready extensions will not executed during these calls.
like image 126
here Avatar answered Sep 29 '22 13:09

here