<script type="text/javascript">
dataLayer = [];
dataLayer.push({
'transactionId' : '27628SB013442',
'transactionTotal' : 4760.00,
'transactionTax' : 480.32,
'transactionProducts' : [{
'sku' : '27328SB013442 - 7/1/2016',
'name' : 'Client Name',
'category' : 'GV1K',
'price' : 595.00,
'quantity' : 8
}]
});
dataLayer.push({
'event':'checkout',
'virtualPageURL':'/order-status',
'virtualPageTitle':'confirmation'
});
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer',"GTM-XXXXXX");</script>
<!-- End Google Tag Manager -->
以上是我的静态dataLayer代码段。我创建了一个名为&#34; checkout&#34;的活动。在GTM帐户中。但它不会影响分析概述部分。我的代码有什么问题吗?
编辑:DataLayer已更新为:
dataLayer = []
dataLayer.push({
'event':'checkout',
'transactionType' : 'demo purpose',
'transactionId' : '27628SB013442',
'transactionTotal': 4760.00,
'transactionTax' : 480.32,
'transactionProducts' : [{
'sku' : '27328SB013442 - 7/1/2016',
'name' : 'Client Name',
'category' : 'GV1K',
'price' : 595.00,
'quantity' : 8
}]
});