【问题标题】:Adding Google Adwords gclid parameter to Woocommerce order email将 Google Adwords gclid 参数添加到 Woocommerce 订单电子邮件
【发布时间】:2015-06-24 09:06:27
【问题描述】:

我正在尝试通过 woocommerce 结帐传递 Google Adwords gclid 参数,以便我可以将其包含在我们收到订单时收到的确认电子邮件中。

我已经设法在这里找到了如何将 gclid 参数存储在 cookie 中: https://support.google.com/adwords/answer/2998031?hl=en(点击“启用您的网站和潜在客户跟踪系统”。但我现在不知道如何将此 cookie 数据输入订单确认电子邮件,我想我将不得不以某种方式在结帐中添加一个隐藏字段页面,然后将数据传递到电子邮件,但我不确定如何执行此操作。

【问题讨论】:

    标签: php wordpress cookies woocommerce google-ads-api


    【解决方案1】:

    这是一个代码,可帮助您在管理员电子邮件中发送数据。 我不知道您最初是如何获得 Google Adwords gclid 参数,但您可以尝试以下方法:

    您只需在代码中的 echo 语句中添加 Google Adwords gclid 参数即可。

    add_action('woocommerce_email_customer_details','my_custom_data',10,3);
    function my_custom_data( $order, $sent_to_admin, $plain_text ){
        if(true==$sent_to_admin){
        echo "the magic code to get Google Adwords gclid parameter";
        }
    }
    

    如果这对你有用,请告诉我。

    【讨论】:

      猜你喜欢
      • 2016-08-02
      • 1970-01-01
      • 2022-01-10
      • 1970-01-01
      • 2014-04-24
      • 1970-01-01
      • 2020-12-15
      • 2013-06-13
      • 2019-03-15
      相关资源
      最近更新 更多