Adobe DTM在eVar和sProp中设置查询字符串 [英] Adobe DTM to set query string in eVar and sProp
问题描述
所以通常我会使用s.getQueryParam();解析我的URL以获得我一直在使用的查询字符串。
So normally I would use the s.getQueryParam(); to parse out my URLs for query strings that I've been using.
s.eVar8 = s.getQueryParam('cid,pid,eid',':');
s.prop28 = s.getQueryParam ('Role');
s.eVar8=s.getQueryParam('cid,pid,eid',':');
s.prop28=s.getQueryParam('Role');
但是由于DTM内置了所有功能,您将如何真正定义它?我知道我可以使用Campaign变量设置页面加载规则,但是如果我有多个用:分隔的参数怎么办?
But since DTM has that all built into it, how would you really define that? I know I can set a page load rule using the campaign variable, but what if I have multiple parameters separated by ":"
www.domain.com?cid=blah1 :blah2:blah3& pid = blah4:blah5:blah6& eid = blah7:blah8:blah9
www.domain.com?cid=blah1:blah2:blah3&pid=blah4:blah5:blah6&eid=blah7:blah8:blah9
使用此方法时是否缺少某些内容?我应该将这些值捕获到数据元素中,然后使用eVar或sProp将数据元素传递到页面加载规则中吗?
Is there something that I'm missing when using this approach? Should I be capture these values into a data element then passing the data element into a page load rule using an eVar or sProp?
推荐答案
对于仅查找单个URL参数的变量:
创建类型的数据元素 URL参数
。对于参数名称,请输入 prop28
的角色(无引号)。另外,您也可以对多个对象执行以下相同操作。
Create a Data Element of Type URL Parameter
. For Parameter Name, put e.g. "Role" (no quotes) for prop28
. Alternatively, you can do the same thing below, for multiple.
对于要查找多个URL参数的变量:
创建类型 自定义脚本
的数据元素。单击 [打开编辑器]
按钮,然后在代码框中添加以下内容:
Create a Data Element of Type Custom Script
. Click the [Open Editor]
button and in the code box, add the following:
var d=':',
p=['cid','pid','eid'],
v=[],c,l,q;
for (c=0,l=p.length;c<l;c++) {
q=_satellite.getQueryParamCaseInsensitive(p[c]);
if (q) v.push(q);
}
return v.join(d);
d =
和 p =
的值基于 eVar8
的值。这与AA的 s.getQueryParam
插件不是100%相同,但大部分是相同的;根据您发布的代码关注的零件。
The d=
and p=
values are based on what you have for eVar8
. This isn't 100% the same as AA's s.getQueryParam
plugin but it's most of it; the parts you care about based on your posted code.
引用数据元素
在 Adobe中Google Analytics(分析)工具配置中,在全局变量部分中,您可以使用%data_element_name_here%$ c在其中添加道具和eVar。 $ c>语法。
In the Adobe Analytics tool config, in the Global Variables section, you can add your prop(s) and eVar(s) there, using %data_element_name_here%
syntax.
这篇关于Adobe DTM在eVar和sProp中设置查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!