Subversion Repositories SmartDukaan

Rev

Rev 12530 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12530 Rev 12551
Line 190... Line 190...
190
 
190
 
191
    <script type="text/javascript" charset="utf-8">
191
    <script type="text/javascript" charset="utf-8">
192
        #set($sorders = $action.getSuccessfulOrders())
192
        #set($sorders = $action.getSuccessfulOrders())
193
        #if($sorders && $sorders.size() != 0)
193
        #if($sorders && $sorders.size() != 0)
194
            #foreach($order in $sorders)
194
            #foreach($order in $sorders)
195
                if(typeof _gaq != "undefined" && _gaq != null)  {
-
 
196
                	ga('ecommerce:addTransaction', {
195
            	ga('ecommerce:addTransaction', {
197
			          'id': '$order.getId()',                // order ID - required
196
		          'id': '$order.getId()',                // order ID - required
198
			          'affiliation': '$action.getStoreAffiliate()',                       // affiliation or store name
197
		          'affiliation': '$action.getStoreAffiliate()',                       // affiliation or store name
199
			          'revenue': '$order.getTotal_amount()',      // total - required
198
		          'revenue': '$order.getTotal_amount()',      // total - required
200
			          'shipping': '0',                  // Shipping
199
		          'shipping': '0',                  // Shipping
201
			          'tax': '0',                             // tax
200
		          'tax': '0',                             // tax
202
			        });
201
		        });
203
                #set($lineitems = $order.getLineitems())
202
                #set($lineitems = $order.getLineitems())
204
                #foreach($lineitem in $lineitems)
203
                #foreach($lineitem in $lineitems)
205
                    var prod_name = '';
204
                    var prod_name = '';
206
                    #if($lineitem.getBrand()) 
205
                    #if($lineitem.getBrand()) 
207
                        prod_name += '$lineitem.getBrand()'; 
206
                        prod_name += '$lineitem.getBrand()'; 
Line 220... Line 219...
220
			          'price': '$lineitem.getUnit_price()',                 // Unit price
219
			          'price': '$lineitem.getUnit_price()',                 // Unit price
221
			          'quantity': '$lineitem.getQuantity()'                   // Quantity
220
			          'quantity': '$lineitem.getQuantity()'                   // Quantity
222
			        });
221
			        });
223
                #end
222
                #end
224
                    ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
223
                    ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
225
                }
-
 
226
            #end
224
            #end
227
        #end
225
        #end
228
    </script>
226
    </script>
229
    
227
    
230
    
228