[英]How to put the Google Adwords Conversion Tracking Pixel in OpenCart 3.x
我想在結帳成功頁面上將adwords轉換像素代碼放在OpenCart 3.x中。
如何才能在結帳成功頁面的標題中插入代碼?
非常感謝。
我嘗試搜索stackoverflow站點和opencart論壇,但沒有在任何地方提供直接的答案。
<!-- Event snippet for conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'XYZ12345',
'transaction_id': ''
});
</script>
確保路由從控制器傳遞到標題模板,然后在標題模板中寫下您的Google代碼:
<?php if ($data['route'] == 'checkout/success') { ?>
<!-- Event snippet for conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'XYZ12345',
'transaction_id': ''
});
</script>
<?php } ?>
您還必須為“send_to”和“transaction_id”輸出正確的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.