Sha256: 22330c428acdd8e20765065c9ae849bc1cd375cd95ba91c7e60a2b4f1fe4c2eb

Contents?: true

Size: 630 Bytes

Versions: 2

Compression:

Stored size: 630 Bytes

Contents

<% if ga_enabled? && @order.present? && !@order.completed? %>
  <script>
    window.addEventListener('turbolinks:load', function() {
      if (typeof gtag !== 'undefined') {
        clearGAplugins();
        gtag('event', 'checkout_progress', {
          checkout_step: '<%= (@order.checkout_steps.index(@order.state) + 1) %>',
          items: [
            <% @order.line_items.each do |line_item| %>
              <%= ga_line_item(line_item) %>,
            <% end %>
          ],
          coupon: '<%= @order.promo_code %>',
          checkout_option: '<%= @order.state %>'
        });
      };
    });
  </script>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_analytics_trackers-2.1.1 app/views/spree/shared/trackers/google_analytics/_checkout_step_viewed.js.erb
spree_analytics_trackers-2.1.0 app/views/spree/shared/trackers/google_analytics/_checkout_step_viewed.js.erb