Omniture - Is it possible to count number of click

2019-09-09 04:07发布

问题:

I'm trying to figure out is it possible to track number of clicks per special links via Omniture.js (s_code.js). For example -

Set of links should have something like tag_1, others tag_2 etc.:

<a href="#" data-tag="tag_1">Menu link 1</a>
<a href="#" data-tag="tag_1">Menu link 2</a>
<a href="#" data-tag="tag_1">Menu link 3</a>

<div class="some-wrapper">
   <a href="#" data-tag="tag_2">Some button</a>
</div>

On click I need to +1 for special tag, that's way counting number of clicks per different classes of links.

Official documentation is really confusing, should I somehow do this by specifying eVars or props?

回答1:

Different variables can be used to populate different reports. Which variables you want to populate depend on what business questions you are trying to answer. For example, if you simply want a running count of # of clicks and that's it, all you really need is the answer provided by @BrettAHale. But if you are looking for more robust reporting, e.g. correlating clicks with other activities or data, then you're going to want to populate some of the other variables.

Providing general training for the variables and what reports they populate is outside the scope of Stack Overflow. If the documentation is too confusing then I suggest you enroll in some of the training courses Adobe offers. But, if you have a specific question about a specific variable that you are confused about, feel free to ask.



回答2:

<a href="#" onClick="s.tl(this,'o','tag_1');”>Menu link 1</a>

This makes some assumptions:

  1. Your Omniture object is named "s"
  2. You don't need any additional props and evars set

This method will surface data in the custom links report with tag_1, tag_2 etc as the line items.