Sha256: 023bc9842f97fa8ec1acb76125756a426f3e2e72af578d76c4418e783a5f11dc

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

<% if params[:search].present? %>
  <script>
    if (typeof analytics !== 'undefined') {
      analytics.track('Product List Filtered', {
        filters: [
          <% params[:search].to_unsafe_h.each do |type, value| %>
            <%= { type: type, value: value } .to_json.html_safe %>,
          <% end %>
        ],
        products: [
        <% @products.each_with_index do |product, index| %>
          <%= product_for_segment(product, position: index+1, image: product.images.first) %>,
        <% end %>
        ]
      });

      analytics.page('Product List Filtered', {
        filters: [
          <% params[:search].to_unsafe_h.each do |type, value| %>
            <%= { type: type, value: value } .to_json.html_safe %>,
          <% end %>
        ],
        products: [
        <% @products.each_with_index do |product, index| %>
          <%= product_for_segment(product, position: index+1, image: product.images.first) %>,
        <% end %>
        ]
      });

    }
  </script>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_analytics_trackers-1.1.0 app/views/spree/shared/trackers/segment/_product_list_filtered.js.erb
spree_analytics_trackers-1.0.1 app/views/spree/shared/trackers/segment/_product_list_filtered.js.erb