Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

Making numerous calls to omniture from same page utilizing JavaScript

Avatar

Former Community Member

Greetings, We are creating site where we are making different ajax calls from a solitary page. We have to track result each of these calls with omniture. There are diverse occasions and eVars characterized in omniture. We are confronting an issue with the way omniture javascript works. There is a capacity s_gi(accountId) that we are getting back to get back an item to which we set every one of the properties. The issue is that, once we call s_gi(accountId), all the resulting calls give back the same properties article, holding all the information that is set already. We have to set new arrangement of properties inevitably. Is there an approach to do this with omniture javascript? e.g. On the off chance that we need to set "event1" for ajax call1, and "event2" for ajax call2, we are accomplishing something like this. For event1, var s = s_gi(accountId) s.events="event1" var s_code = s.t(); if(s_code) { document.write(s_code); } For occasion 2 var s = s_gi(accountId) s.events="event2" s.eVar2 = "administration" var s_code = s.t(); if(s_code) { document.write(s_code); } Is this substantial use? We need to make different calls, in light of the fact that there is nobody "end" point on our site, where we can gather every one of the occasions/eVars and submit without a moment's delay. Much obliged, Unmesh 

regards

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Here are the two pages you'll want to look at to resolve your issue.

Implementing for AJAX discusses the issues you're running into: https://marketing.adobe.com/resources/help/en_US/sc/implement/impl_media_ajax.html

Using the clearVars function to start with a clean slate every time to fire an image request: https://marketing.adobe.com/resources/help/en_US/sc/implement/function_clearVars.html

Basically, whenever you trigger the s.t() function, right after that you'll want to trigger the s.clearVars() function so previously defined variables are not sent in subsequent image requests.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Here are the two pages you'll want to look at to resolve your issue.

Implementing for AJAX discusses the issues you're running into: https://marketing.adobe.com/resources/help/en_US/sc/implement/impl_media_ajax.html

Using the clearVars function to start with a clean slate every time to fire an image request: https://marketing.adobe.com/resources/help/en_US/sc/implement/function_clearVars.html

Basically, whenever you trigger the s.t() function, right after that you'll want to trigger the s.clearVars() function so previously defined variables are not sent in subsequent image requests.