【问题标题】:how to get the values from meta tag in adobe launch or adobe analytics如何从 adobe 启动或 adobe 分析中的元标记获取值
【发布时间】:2020-01-22 14:59:31
【问题描述】:

在元标记中,“name”属性作为变量名,“content”属性作为该变量的值。

<meta name="pageType" content="category" />
 <meta name="Country" content='india'/>

该变量将捕获为:pageType = "category" 当“pageType”与条件匹配时,“category”的值应该进入“evars” 例子 :- evar5 = 类别和 evar6 = 印度。

【问题讨论】:

  • 你为什么用“tealium”标记你的问题?您是否在 Launch Tealium 中寻找解决方案?

标签: javascript meta-tags adobe-analytics tealium adobe-launch


【解决方案1】:

您可以尝试执行类似的操作来获取元标记的名称和内容并触发您的 Adob​​e 标记。您可以在名称和内容上添加任何“if”条件以仅传递某些值。此外,您需要将“名称”和“内容”映射到 Adob​​e 标签上的相应 eVar。

var temp_obj = {};
var metaElements = document.getElementsByTagName('meta');
for (var i = 0; i < metaElements.length; i++) {
    temp_obj.name = metaElements[i].name;
    temp_obj.content = metaElements[i].content;
    utag.link(temp_obj, null, [{UID of your Adobe Tag}])
}

【讨论】:

    【解决方案2】:

    我终于明白了。

    var meta = document.getElementsByTagName("meta"); 大小 = 元长度;

    for(var i=0; i<size; i++) {
        if(meta[i].getAttribute("name")== "pwc_publication_date")
        {
            s.eVar6 = meta[i].getAttribute("content");
        }
        if(meta[i].getAttribute("name")== "pwc_title")
        {
            s.eVar5= meta[i].getAttribute("content");
        }
        if(meta[i].getAttribute("name")== "pwc_articletype")
        {
            s.eVar7= meta[i].getAttribute("content");       }
        if(meta[i].getAttribute("name")== "pwc_modified_date")
        {
            s.eVar8= meta[i].getAttribute("content");       }
        if(meta[i].getAttribute("name")== "pwc_tags")
        {
            s.eVar9= meta[i].getAttribute("content");       }   
        if(meta[i].getAttribute("name")== "pwc_headline_image")
        {
            s.eVar10= meta[i].getAttribute("content");      }   
    }
    

    如果您也更改元标记顺序,您可以将值存储到特定变量中。

    感谢您的帮助....

    【讨论】:

      猜你喜欢
      • 2019-12-02
      • 2019-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多