Sha256: ddf01bfdd8b72f0f3725250dbab006885544e0b6f657f16e01e660f621cd180a

Contents?: true

Size: 467 Bytes

Versions: 2

Compression:

Stored size: 467 Bytes

Contents

<% if segment_enabled? && @order.present? && order_just_completed?(@order) %>
  <% order_json = SpreeAnalyticsTrackers::Segment::OrderPresenter.new(@order).to_json %>
  <script>
    window.addEventListener('turbolinks:load', function() {
      if (typeof analytics !== 'undefined') {
        analytics.page('Order Completed', <%= order_json.html_safe %>);
        analytics.track('Order Completed', <%= order_json.html_safe %>);
      }
    });
  </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/segment/_order_complete.js.erb
spree_analytics_trackers-2.1.0 app/views/spree/shared/trackers/segment/_order_complete.js.erb