Google代码跟踪

填写GA账户:

 

谷歌ads跟踪代码


<script>
try {
gtag('config', 'AW-622544975');
// 浏览页面
gtag('event', 'conversion', { send_to: 'AW-622544975/ZMXwCIbV2O4BEM-Q7agC' });

$(function () {
// 查看sku
$(document.body).on('zz.viewItem', function (e, data) {
gtag('event', 'conversion', { send_to: 'AW-622544975/XZr6CJvV2O4BEM-Q7agC' });
});
// 搜索
$(document.body).on('zz.productSearch', function (e, v) {
gtag('event', 'conversion', { send_to: 'AW-622544975/xbtXCLPV2O4BEM-Q7agC' });
});
// 加购
$(document.body).on('zz.addToCart', function (e, v) {
gtag('event', 'conversion', { send_to: 'AW-622544975/KnUvCMb26O4BEM-Q7agC' });
});
// 发起结账
$(document.body).on('zz.initiateCheckout', function (e, v) {
gtag('event', 'conversion', { send_to: 'AW-622544975/W3GWCJz26O4BEM-Q7agC' });
});
// 添加支付信息
$(document.body).on('zz.addPaymentInfo', function (e, v) {
gtag('event', 'conversion', { send_to: 'AW-622544975/7yL_CPzT2O4BEM-Q7agC' });
});
// 支付成功
$(document.body).on('zz.purchase', function (e, v) {
gtag('event', 'conversion', {
send_to: 'AW-622544975/BDNSCIuwtu4BEM-Q7agC',
value: v.value,
currency: v.currency,
transaction_id: v.order_no
});
});
});
} catch (e) { }
</script>

 

GA账号:

 

注意是UA开头,如果不是UA开头则设置账号有问题