admin管理员组文章数量:1406937
I'm trying to access Click event related variables in custom javascript. Click event variables should be so called built-in variables but still it states unknown.
I'm using following syntax which is supposed to get ID of clicked link and return social media action per ID:
function() {
var some = {{Click ID}};
if (some == "tw")
return 'tweet';
else
return 'share';
}
EDIT: For me it looks like I'm using variables just like on this page / but what is the problem?
I'm trying to access Click event related variables in custom javascript. Click event variables should be so called built-in variables but still it states unknown.
I'm using following syntax which is supposed to get ID of clicked link and return social media action per ID:
function() {
var some = {{Click ID}};
if (some == "tw")
return 'tweet';
else
return 'share';
}
EDIT: For me it looks like I'm using variables just like on this page http://www.apasters./blog/google-tag-manager-custom-javascript-variable-examples/ but what is the problem?
Share edited Jan 17, 2017 at 11:22 user1271930 asked Jan 17, 2017 at 11:17 user1271930user1271930 3411 gold badge8 silver badges22 bronze badges 2- can I just ask why there are no braces around your if statement? – Ben Davison Commented Jan 17, 2017 at 11:43
- There's no need for curly braces for single-line if statements, but I normally use them anyway for aesthetics, :) – nyuen Commented Jan 17, 2017 at 14:47
1 Answer
Reset to default 7You need to make sure that you have enabled/activated the built-in variables before you use them, otherwise you get that error message.
本文标签: Google Tag Manager custom Javascript quotUnknown variable Click IdquotStack Overflow
版权声明:本文标题:Google Tag Manager custom Javascript: "Unknown variable {{Click Id}}" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745055343a2639897.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论