Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.13 KB | None | 0 0
  1. <%
  2. if(recent)
  3. {
  4.     %>
  5.     <!-- GOOGLE ANALYTICS E-COMERCE DATA -->
  6.     <script type="text/javascript">
  7.         // Load Ecommerce Tracking Object
  8.         ga('require', 'ecommerce');
  9.  
  10.         // Add total transaction data to shopping cart
  11.         ga('ecommerce:addTransaction', {
  12.           'id': '<%=info.getInvoiceId()%>',             // Transaction ID.
  13.           'affiliation': '<%=StaticData.WEB_SITE_NAME%>',   // Store Name.
  14.           'revenue': '<%=info.getReservationWithVat()%>',   // Grand Total.
  15.           'shipping': '0',                  // Shipping.
  16.           'tax': '<%=info.getVatFee()%>',           // Tax.
  17.           'currency': 'EUR'                             // Currency code.
  18.         });
  19.  
  20.         // Individual item data.
  21.         ga('ecommerce:addItem', {
  22.           'id': '<%=info.getInvoiceId()%>',             // Transaction ID.
  23.           'name': '<%=apInfo.getName()%>',              // Product name.
  24.           'sku': '<%=info.getReference()%>',            // SKU/code.
  25.           'category': '<%=info.getPax()%> pax',                 // Category.
  26.           'price': '<%=info.getReservationWithVat()%>',         // Unit price.
  27.           'quantity': '1'                               // Quantity.
  28.         });
  29.  
  30.         // Send transaction data to Google Analytics
  31.         ga('ecommerce:send');
  32.     </script>
  33.     <%
  34. }
  35. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement