Question

Our web site was developed using ASP.NET MVC4 using clinet side technlogies knockout,jquery and Kendo .We are implementing omniture sitecatalyst web analtics tool to capture user information.I have defined following variables to capture page views.

**variables defined using sitecatalyst**

SiteCatalyst code version: H.25

//Traffic Variables

s.pageName="home"
s.server="server1"
.s.channel="channel1"

// Conversion Variables 

s.eVar1="loginid

we have products page with product image,product name and rates and if user clicks on prodcut image it will show pop up window with related information of that product.To display this information we are dynamically creating table using javascript on that page and looks similar to below code.

Code

var html='<tbody';
var onclicktext="onclick=prodclickapply(products,id);"
html+='<tr valign="top" productid=""
html+='<td class="prodimage">
html+='<img class="prodimage> src=""+"/>
html+='</td>;
html+='<td class="prodname">;
html+='</tr>;
html+='</tbody>';

Now I need to find how many times a particular product clicked and the user (loginid) using sitecatalyst javascript tagging on the products page.Not sure if I need use custom events or conversion variables to achieve this and little bit confused .Please suggest me with code how can I achieve this?

Thanks in Advance

Was it helpful?

Solution

Your code has lots of syntax errors, but that aside..

user(loginid) : Assuming eVar1 is visit scoped, you don't need to pop it when the visitor views the product; it just needs to be popped once during the visit and it be tied to any activities for the rest of the visit. If your logic is setup to pop it on every hit though, it's not that big a deal.. it will inflate your instances metric, but that metric is pretty useless anyways.

product view : There is an ecommerce event for this called prodView that you can use, along with the products variable to record details about the product. Make sure you enable ecommerce tracking for your report suite(s) and enable the prodView (and other ecommerce events, since you'll probably be doing that next). You should read the implementation manual about the products variable; it can be quite complex. But for a basic implementation you just need to pass a product id to it (and a product category too if you have that, but fyi the category report is pretty useless so hardly anybody ever bothers).

Here is a wrapper function to pop the relevant stuff; add it to your click event:

function s_viewProduct(id) {
  s.linkTrackVars = 'products,events';
  s.linkTrackEvents = 'prodView';
  s.events = 'prodView';
  s.products = ';'+id;
  s.tl(true,'o','product view');
}

id should be the product id, and should be something unique to the product. You can use a report-friendly name if you want instead (as long as its unique), or you can use a generated id associated with the product (you can then make use of SAINT classifications to import report-friendly names if you want). Make sure whatever you use does not contain semicolons or commas (strip them if they do), since those are delimiters used in the products variable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top