WordPress制作的广告落地页表单, 如何追踪询盘对应的产品?

如何追踪询盘对应的产品呢?
我们用WordPress做Google ads广告落地页,比如下图模拟的产品展示方式,在每个产品下方都会有Inquire 发送询盘按钮, 点击后弹出填写表单,这个时候如果你收到了询盘,你可以知道客人是点击哪个产品过来的询盘吗? 如果我们知道客人是问的那个产品,这个时候针对性回复询盘,那么我们的询盘回复率也会相应提高。具体操作方法,我们在下方介绍:

如何追踪询盘对应的产品

1、在Wordpress+Elementor 环境下复制一个弹窗表单,命名为Product Popup Form(弹出表单形式)

产品表单

2.进入 Elementor页面 编辑弹窗表单

进入 Elementor 编辑弹窗表单

在Form表单组件上方添加html组件,然后添加以下代码 :

<div class="product-display-container" id="product-display-container" style="display: none;">
  <div class="product-info">
    <h4>Inquiry Product:</h4>
    <p id="selected-product-name" class="product-name">
      Waiting for selection...
    </p>
  </div>
</div>


<style>
.product-display-container {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #35C0F4;
}


.product-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


.product-info h4 {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: normal;
}


.product-name {
  margin: 0;
  font-weight: bold;
  color: #35C0F4;
  font-size: 18px;
  text-align: center;
}
</style>


<script>
document.addEventListener('DOMContentLoaded', function() {


  // 新隐藏字段
  function updateElementorFormField(productName) {
    const fields = document.querySelectorAll('input[name="form_fields[product_name]"], input[id="form-field-product_name"]');
    fields.forEach(field => {
      field.value = productName || '';
      // 触发 input 事件让Elementor刷新字段状态
      field.dispatchEvent(new Event('input', { bubbles: true }));
    });
  }


  // 更新显示区域
  function updateProductInPopup(productName) {
    const container = document.getElementById('product-display-container');
    const productElement = document.getElementById('selected-product-name');
    if (!container || !productElement) return;


    if (productName && productName.trim() !== '') {
      container.style.display = 'block';
      productElement.textContent = productName;
      updateElementorFormField(productName);
    } else {
      container.style.display = 'none';
      productElement.textContent = 'Waiting for selection...';
      updateElementorFormField('');
    }
  }


  // 清除数据
  function clearProductData() {
    window.selectedProductName = null;
    sessionStorage.removeItem('selectedProduct');
    localStorage.removeItem('selectedProduct');
    updateProductInPopup('');
  }


  // 点击产品卡立即更新
  document.addEventListener('click', function(e) {
    let target = e.target;
    while (target && target !== document.body) {
      if (target.hasAttribute('data-product')) {
        const productName = target.getAttribute('data-product');
        window.selectedProductName = productName;
        sessionStorage.setItem('selectedProduct', productName);
        updateProductInPopup(productName);
        return;
      }
      target = target.parentElement;
    }
  });


  // 弹窗关闭时清空
  document.addEventListener('click', function(e) {
    if (
      e.target.classList.contains('elementor-popup-close') ||
      e.target.classList.contains('elementor-popup-modal') ||
      e.target.classList.contains('close-btn') ||
      e.target.closest('.elementor-popup-close')
    ) {
      clearProductData();
    }
  });


  document.addEventListener('keydown', function(e) {
    if (e.key === 'Escape') clearProductData();
  });


  // 初始化
  clearProductData();


});
</script>




这里要根据网站主题颜色替换对应颜色样式代码

根据网站主题颜色替换对应颜色样式

3.在Form表单组件里添加隐藏字段

放第一个

在form组件里添加隐藏字段1
在form组件里添加隐藏字段2
在form组件里添加隐藏字段3

字段类型:Hidden

字段名称:product_name

ID :product_name

下面的Shortcode不用管,填完id会自动变

4.邮件设置

邮件设置

Subject内容下:

设置邮件标题内容:
New Inquiry for [field id=”product_name”] from (你的网站域名)

填完发布

5.给产品添加属性值

给产品添加属性值

选择产品图片,给要【添加弹窗的组件】添加产品名属性(盒子、按钮都可以)

格式为:data-product|产品名

发送询盘的按钮也是同样的操作方式

6.选择弹窗模板-product popup form

选择弹窗模板

7.重复操作为其他产品添加属性,进行测试

重复操作为其他产品添加属性

完成后,你就能看到询盘收到后分别是对应什么产品了。

关于如何追踪询盘对应的产品问题,如果您在设置中还有疑问,欢迎与我们海派网络联系。

版权声明: 本文为本站原创内容,未经授权严禁复制、转载或用于商业用途。若需转载,请务必注明出处并保留原文链接。任何未经许可的抄袭、盗用行为,一经发现将依法追究其法律责任。

Picture of 海派老戴Kevin

海派老戴Kevin

大家好,我是海派网络的创始人老戴kevin,一个在外贸网站建设和推广行业扎根20年的“老互联网人”。

从2004年开始合作中国制造网,到2007年提出“外贸网络生意从企业独立站推广开始”的理念,这一路走来,做过不少成功的项目,也踩过不少坑——但每一次失败都让我更清楚,什么才是真正能帮到客户的东西。

我是个技术出身的企业经营者,深知做好服务的关键在于:专注客户需求、持续技术突破、培养优秀团队。有时候,看到客户因为我们的服务取得突破,比自己赚钱还开心,甚至忍不住投入更多资源去优化(虽然常被合伙人说“太理想主义”,哈哈)。

我始终相信,中国制造的品牌故事值得被世界看见。如果我的经验能帮到正在探索外贸数字化的你,或者你也有好的想法想交流,欢迎随时联系我——一起让更多中国企业在国际市场上闪闪发光!

5 1 投票
文章评分
guest
0 评论
最旧
最新 最多投票
内联反馈
查看所有评论

欢迎与我们交流,表单提交后,我们将在12小时内给您及时回复。