@@ -1087,14 +1087,14 @@ describe('Google Analytics', function() {
1087
1087
it ( 'should send product impression data via product list viewed' , function ( ) {
1088
1088
// If using addImpression ever becomes optional, will need to add a setting modification here.
1089
1089
ga . options . setAllMappedProps = false ;
1090
- ga . options . dimensions = { testDimension : 'dimension1' } ;
1091
- ga . options . metrics = { testMetric : 'metric1' } ;
1090
+ ga . options . dimensions = { testDimension : 'dimension1' , productDimension : 'dimension2' } ;
1091
+ ga . options . metrics = { testMetric : 'metric1' , productMetric : 'metric2' } ;
1092
1092
1093
1093
analytics . track ( 'Product List Viewed' , {
1094
1094
category : 'cat 1' ,
1095
1095
list_id : '1234' ,
1096
1096
products : [
1097
- { product_id : '507f1f77bcf86cd799439011' }
1097
+ { product_id : '507f1f77bcf86cd799439011' , productDimension : 'My Product Dimension' , productMetric : 'My Product Metric' }
1098
1098
] ,
1099
1099
testDimension : true ,
1100
1100
testMetric : true
@@ -1105,7 +1105,9 @@ describe('Google Analytics', function() {
1105
1105
id : '507f1f77bcf86cd799439011' ,
1106
1106
category : 'cat 1' ,
1107
1107
list : '1234' ,
1108
- position : 1
1108
+ position : 1 ,
1109
+ dimension2 : 'My Product Dimension' ,
1110
+ metric2 : 'My Product Metric'
1109
1111
} ] ) ;
1110
1112
analytics . deepEqual ( toArray ( window . ga . args [ 3 ] ) , [ 'send' , 'event' , 'cat 1' , 'Product List Viewed' , {
1111
1113
dimension1 : 'true' ,
@@ -1117,8 +1119,8 @@ describe('Google Analytics', function() {
1117
1119
it ( 'should send product impression data via product list filtered' , function ( ) {
1118
1120
// If using addImpression ever becomes optional, will need to add a setting modification here.
1119
1121
ga . options . setAllMappedProps = false ;
1120
- ga . options . dimensions = { testDimension : 'dimension1' } ;
1121
- ga . options . metrics = { testMetric : 'metric1' } ;
1122
+ ga . options . dimensions = { testDimension : 'dimension1' , productDimension : 'dimension2' } ;
1123
+ ga . options . metrics = { testMetric : 'metric1' , productMetric : 'metric2' } ;
1122
1124
1123
1125
analytics . track ( 'Product List Filtered' , {
1124
1126
category : 'cat 1' ,
@@ -1136,7 +1138,7 @@ describe('Google Analytics', function() {
1136
1138
value : 'desc'
1137
1139
} ] ,
1138
1140
products : [
1139
- { product_id : '507f1f77bcf86cd799439011' }
1141
+ { product_id : '507f1f77bcf86cd799439011' , productDimension : 'My Product Dimension' , productMetric : 'My Product Metric' }
1140
1142
] ,
1141
1143
testDimension : true ,
1142
1144
testMetric : true
@@ -1148,7 +1150,9 @@ describe('Google Analytics', function() {
1148
1150
category : 'cat 1' ,
1149
1151
list : '1234' ,
1150
1152
position : 1 ,
1151
- variant : 'department:beauty,price:under::price:desc'
1153
+ variant : 'department:beauty,price:under::price:desc' ,
1154
+ dimension2 : 'My Product Dimension' ,
1155
+ metric2 : 'My Product Metric'
1152
1156
} ] ) ;
1153
1157
analytics . deepEqual ( toArray ( window . ga . args [ 3 ] ) , [ 'send' , 'event' , 'cat 1' , 'Product List Filtered' , {
1154
1158
dimension1 : 'true' ,
0 commit comments