Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- if(recent)
- {
- %>
- <!-- GOOGLE ANALYTICS E-COMERCE DATA -->
- <script type="text/javascript">
- // Load Ecommerce Tracking Object
- ga('require', 'ecommerce');
- // Add total transaction data to shopping cart
- ga('ecommerce:addTransaction', {
- 'id': '<%=info.getInvoiceId()%>', // Transaction ID.
- 'affiliation': '<%=StaticData.WEB_SITE_NAME%>', // Store Name.
- 'revenue': '<%=info.getReservationWithVat()%>', // Grand Total.
- 'shipping': '0', // Shipping.
- 'tax': '<%=info.getVatFee()%>', // Tax.
- 'currency': 'EUR' // Currency code.
- });
- // Individual item data.
- ga('ecommerce:addItem', {
- 'id': '<%=info.getInvoiceId()%>', // Transaction ID.
- 'name': '<%=apInfo.getName()%>', // Product name.
- 'sku': '<%=info.getReference()%>', // SKU/code.
- 'category': '<%=info.getPax()%> pax', // Category.
- 'price': '<%=info.getReservationWithVat()%>', // Unit price.
- 'quantity': '1' // Quantity.
- });
- // Send transaction data to Google Analytics
- ga('ecommerce:send');
- </script>
- <%
- }
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement