简体   繁体   English

将Adobe DTM中的值数组分配给列表变量

[英]Assigning an array of values in Adobe DTM to a list var

I have a list of values which I have gathered from some HTML elements in a page with some javascript. 我有一个值列表,这些值是我从带有一些javascript页面的一些HTML元素中收集的。 I have then stored these within an array called 'a'. 然后,我将它们存储在名为“ a”的数组中。 This is all processed as a data element. 所有这些都作为数据元素处理。

a = 123, 456, 789, 102 a = 123、456、789、102

What I would like to achieve is to find all of the values on a given page then record an instance against each value as an instance, essentially I am counting the number of times an item appears in search results by ID. 我想要实现的是找到给定页面上的所有值,然后将每个值记录为一个实例作为实例,实质上,我是通过ID来计数某项出现在搜索结果中的次数。 The part I am stuck on, is how I would assign these values to a list var and record these as an event. 我坚持的部分是如何将这些值分配给列表var并将其记录为事件。

By calling s.events, s.linkTrackVars and s.linkTrackEvents I was able to record the data within a list variable in omniture. 通过调用s.events,s.linkTrackVars和s.linkTrackEvents,我可以将数据记录在通用的列表变量中。 I have provided the code I used below: 我提供了下面使用的代码:

if (location.href.indexOf('example.com') != '-1') {
    var a = "";

    $('div.info').each(function() {
          if(a.length<1){
            a =($(this).attr('id'))
          }else{
             a = a + "," + ($(this).attr('id'))
          }
        })
        if (a.length > 1)
            s.list1 = a;
                s.events="event100";
                s.linkTrackVars="list1,events";
                s.linkTrackEvents="event100";
                s.tl(true, 'o', 'ID count');
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM