[英]is it possible to send custom variables to Google analytics while using ecommerce extension
所以基本上我正在嘗試使用電子商務擴展程序將自定義變量轉移到谷歌分析面板。 我的主要目標是為每個項目提供一組自定義值。
我的“代碼”看起來像這樣:
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': 'id',
'affiliation': 'affiliation',
});
ga('ecommerce:addItem', {
'id': 'id',
'name': 'Loan - name',
'sku': '{RIDA:success_loan_id}',
'loanSumEur': 'Sum',
'loanSumLit': 'Sum LTL',
'loanLength': 'length',
'loanData': 'data'
});
ga('ecommerce:send');
ga('ecommerce:clear');
我應該如何聲明那些loanSumEur,loanSumLit,loanlength,loanData變量,以便Google將它們傳遞給google analytics管理面板。 它甚至可能嗎?
為站點跟蹤聲明自定義變量非常容易,但是在嘗試對事務項執行相同操作時遇到了一點點困難。
BR的
是的,可以使用自定義維度和指標。
ga('ec:addProduct', { // Provide product details in an productFieldObject.
'id': 'P12345', // Product ID (string).
'name': 'Powerup', // Product name (string).
'category': 'Extras', // Product category (string).
'variant': 'red', // Product variant (string).
'price': '10.00', // Product price (currency).
'quantity': 2, // Product quantity (number).
'dimension4': 'strong', // Product-scoped custom dimension (string).
'metric2': 5 // Product-scoped custom metric (integer).
});
ga('ec:setAction', 'purchase', {
'id': 'T12345',
'revenue': '20.00'
});
ga('send', 'pageview'); // Send transaction data with initial pageview.
請參閱: 自定義維度和指標 - 產品級范圍
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.