0
我正在使用名爲「DuracellTomi的Google Tag Manager」的wordpress google標籤管理器插件。我啓用了電子商務選項。當我把一個測試訂單轉發到一個自定義的感謝頁面。在該謝謝頁我進入JavaScript控制檯模式,並在那裏,我輸入「數據層」,這是標籤管理器電子商務數據層
輸出:
我希望這樣的事情:
transactionId': '1234',
'transactionAffiliation': 'Acme Clothing',
'transactionTotal': 38.26,
'transactionTax': 1.29,
'transactionShipping': 5,
'transactionProducts': [{
'sku': 'DD44',
'name': 'T-Shirt',
'category': 'Apparel',
'price': 11.99,
'quantity': 1
},{
'sku': 'AA1243544',
'name': 'Socks',
'category': 'Apparel',
'price': 9.99,
'quantity': 2
我需要做什麼才能獲得所需的輸出?\
編輯:
我定製感謝頁面設置是這樣的:
// Redirect custom thank you
add_action('woocommerce_thankyou', 'bbloomer_redirectcustom');
function bbloomer_redirectcustom($order_id){
$order = new WC_Order($order_id);
$url = 'http://dexport.nl/bedankt';
if ($order->status != 'failed') {
wp_redirect($url);
exit;
}
}