<% console.log(cart) %>
var dakisId = '<%= cart.id %>'; var dakisSubTotal = '<%= cart.subTotal %>'; var dakisTaxes = '<%= cart.totalTaxes %>'; var dakisTotal = '<%= cart.total %>'; var dakisShipping = '<%= cart.totalShipping %>'; var dakisCurrency = '<%= cart.currency.code %>'; ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id': dakisId, 'revenue': dakisSubTotal, 'shipping': dakisShipping, 'tax': dakisTaxes }); <% for (var i = 0; i < cart.items.length; i++ ) { ga('ecommerce:addItem', { 'id': cart.items[i].id, 'name': cart.items[i].text, 'price': cart.items[i].price, 'quantity': cart.items[i].quantity }); } %> ga('ecommerce:send');
var dakisMerchantId = '<%= cart.id %>'; var dakisId = '<%= cart.id %>'; var dakisEmail = '<%= cart.customer.email %>'; var dakisCountry = '<%= cart.addresses.billing.country %>'; var estimated_delivery_date = new Date(); estimated_delivery_date.setDate(estimated_delivery_date.getDate(), 5); window.renderOptIn = function() { window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { // REQUIRED FIELDS "merchant_id": 118248220, "order_id": dakisId, "email": dakisEmail, "delivery_country": dakisCountry, "estimated_delivery_date": estimated_delivery_date.toLocaleDateString("en-ca",{year:"numeric",month:"2-digit", day:"2-digit"}), }); }); }