如何将值传递给Google标签管理器中创建的变量?
我已经在GTM代码中创建了一个变量来获取电子邮件,但是它需要从Themyou Page脚本收集数据。我使用Zoho表格来做到这一点。有人可以帮忙吗?
这是我正在使用的功能:
function() {
try {
var searchEmail = function(input) {
for(i=0; i<input.length; i++) {
email = input[i].value;
if(email.match(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) {
return email;
}
}
}
return searchEmail({{Form Element}});
} catch(e) {
return "";
}
}
想法是,您在“感谢”页面上输入的代码将emailInput
变量传递给您在“感谢您”页面中的脚本。
I have created a variable in GTM code to fetch emails but It needs to collect the data from the thankyou page Script. I have used Zoho forms to do this. Can somebody help?
Here's the function I'm using:
function() {
try {
var searchEmail = function(input) {
for(i=0; i<input.length; i++) {
email = input[i].value;
if(email.match(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) {
return email;
}
}
}
return searchEmail({{Form Element}});
} catch(e) {
return "";
}
}
The idea is that the code you put in on the thank-you page passes the emailInput
variable to the script you put in the thank-you page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论