1
我目前正在實施Google Analytics增強型電子商務。當我在我的開發環境中購買某些東西時,我檢查了我的開發人員分析購物行爲,並且我僅查看了所有會話和會話中的交易值,但兩者之間沒有任何值。我的代碼如下。在每個ga('ec')之前或之後,我有時會發起事件進行正常分析。我的代碼有什麼問題嗎?增強型電子商務唯一記錄setAction
// All values are angular expressions that I've
// double triple checked to make sure they give good values
ga('ec:addImpression', 'detail',{
'id': $location.search().tripToken,
'name': $scope.holds[a].value,
'price': $scope.holds[a].price,
'category' : tileDisable
});
ga('send','pageview')
// Next GA fire a bit later
ga('ec:addProduct', 'checkout', {
'id': $location.search().tripToken,
'name': optionType,
'price': $scope.getOptionPrice(optionType),
'quantity': parseInt($scope.baseInfo.total_travelers)
});
ga('send','pageview');
// A bit later
ga('ec:setAction', 'purchase', {
'id': $scope.userData.option_type,
'affiliation': $scope.userData.token,
'revenue': $scope.userData.option_price * $scope.baseInfo.total_travelers
});
ga('send','pageview');