dpnv33177
2018-06-05 20:20
浏览 65
已采纳

在Woocommerce中的Adword转换代码中添加订单数据

I have an adwords conversion code which I want to add in my child theme.I want to insert the Total purchase Amount in the "value" attribute in this piece of code so that each time the code is triggered the total amount in cart is added to the conversion.

<script async src="https://www.googletagmanager.com/gtag/js?id=AW-806400000"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());

            gtag('config', 'AW-806400000"');
            gtag('event', 'conversion', {
                  'send_to': 'AW-806400000"/iHbjCOSfAewkasdowew',
                  'value': 1.0, **[Get the Total from cart and use here]**
                  'currency': 'USD',
                  'transaction_id': ''
              });

        </script>

图片转代码服务由CSDN问答提供 功能建议

我有一个adwords转换代码,我想在我的孩子主题中添加。我想插入总购买金额 在这段代码的“value”属性中,每次触发代码时,购物车中的总金额就会被添加到转换中。

 &lt; script async src =  “https://www.googletagmanager.com/gtag/js?id=AW-806400000"></script>
&lt; script&gt; 
 window.dataLayer = window.dataLayer ||  []; 
 function gtag(){dataLayer.push(arguments);} 
 
gtag('js',new Date()); 
 
 
gtag('config','AW-806400000“');  
 gtag('event','conversion',{
'send_to':'AW-806400000“/ iHbjCOSfAewkasdowew',
'value':1.0,** [从购物车中获取总数并在此处使用] **  
'currency':'USD',
'transaction_id':''
}); 
 
&lt; / script&gt; 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题