如何将值传递给Google标签管理器中创建的变量?

发布于 2025-01-27 16:42:04 字数 621 浏览 2 评论 0原文

我已经在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文