Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {%- first_time_accessed and order.gateway == 'mobilepay_via_quickpay' -%}
- <script>
- function eventConversion() {
- if (typeof ga !== 'undefined') {
- ga('ecommerce:addTransaction', {
- "id": {{ order.name | json }},
- "revenue": "{{ order.total_price | money_without_currency | replace: '.', '' | replace: ',': '.' }}",
- "shipping": "{{ order.shipping_price | money_without_currency | replace: '.', '' | replace: ',': '.' }}",
- "tax": "{{ order.tax_price | money_without_currency | replace: '.', '' | replace: ',': '.' }}",
- });
- {%- for item in order.line_items -%}
- ga('ecommerce:addItem', {
- "id": {{ order.name | json }},
- "name": {{ item.title | json }},
- "sku": {{ item.sku | json }},
- "price": "{{ item.price | money_without_currency | replace: '.', '' | replace: ',': '.' }}",
- "quantity": {{ item.quantity | json }},
- });
- {%- endfor -%}
- ga('ecommerce:send');
- } else {
- setTimeout(eventConversion, 500);
- }
- };
- eventConversion();
- </script>
- {%- endif -%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement