spree_analytics_trackers 1.1.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.travis.yml +30 -36
- data/Appraisals +3 -16
- data/LICENSE +1 -1
- data/README.md +7 -3
- data/app/assets/javascripts/spree/frontend/add_to_cart_analytics.js +46 -0
- data/app/controllers/spree_analytics_trackers/store_controller_decorator.rb +6 -3
- data/app/helpers/spree/trackers_helper.rb +58 -20
- data/app/overrides/add_cart_viewed_to_orders_edit.rb +1 -1
- data/app/overrides/add_checkout_step_viewed_to_checkout_edit.rb +11 -3
- data/app/overrides/add_google_analytics_page_view_to_spree_application.rb +18 -0
- data/app/overrides/add_google_analytics_to_spree_application.rb +11 -3
- data/app/overrides/add_google_purchase_to_orders_show.rb +1 -1
- data/app/overrides/add_product_list_filtered_to_taxons_show.rb +1 -1
- data/app/overrides/add_product_list_viewed_to_products_list.rb +1 -1
- data/app/overrides/add_product_viewed_to_products_show.rb +2 -2
- data/app/overrides/add_products_searched_to_products_list.rb +2 -2
- data/app/overrides/add_segment_initializer_to_layout.rb +10 -2
- data/app/overrides/add_segment_page_viewed_to_layout.rb +18 -0
- data/app/presenters/spree_analytics_trackers/base_presenter.rb +14 -0
- data/app/presenters/spree_analytics_trackers/segment/order_presenter.rb +32 -0
- data/app/presenters/spree_analytics_trackers/segment/product_presenter.rb +40 -0
- data/app/views/spree/shared/trackers/google_analytics/_checkout_step_viewed.js.erb +21 -0
- data/app/views/spree/shared/trackers/google_analytics/_initializer.js.erb +11 -0
- data/app/views/spree/shared/trackers/google_analytics/_page_viewed.js.erb +13 -0
- data/app/views/spree/shared/trackers/google_analytics/_purchase.js.erb +19 -0
- data/app/views/spree/shared/trackers/segment/_cart_viewed.js.erb +21 -21
- data/app/views/spree/shared/trackers/segment/_checkout_step_viewed.js.erb +14 -12
- data/app/views/spree/shared/trackers/segment/_initializer.js.erb +1 -2
- data/app/views/spree/shared/trackers/segment/_order_complete.js.erb +3 -43
- data/app/views/spree/shared/trackers/segment/_page_viewed.js.erb +7 -0
- data/app/views/spree/shared/trackers/segment/_product_list_filtered.js.erb +7 -18
- data/app/views/spree/shared/trackers/segment/_product_list_viewed.js.erb +16 -21
- data/app/views/spree/shared/trackers/segment/_product_viewed.js.erb +10 -6
- data/app/views/spree/shared/trackers/segment/_products_searched.js.erb +1 -1
- data/config/locales/en.yml +0 -2
- data/config/locales/zh-TW.yml +19 -0
- data/gemfiles/{spree_3_5.gemfile → spree_4_1.gemfile} +2 -2
- data/gemfiles/spree_master.gemfile +0 -1
- data/lib/generators/spree_analytics_trackers/install/install_generator.rb +7 -0
- data/lib/spree_analytics_trackers.rb +1 -0
- data/lib/spree_analytics_trackers/version.rb +4 -3
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +3 -1
- data/spec/features/products_spec.rb +315 -0
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/presenters/spree_analytics_trackers/segment/order_presenter_spec.rb +34 -0
- data/spec/spec_helper.rb +7 -82
- data/spec/support/custom_products.rb +26 -0
- data/spree_analytics_trackers.gemspec +3 -17
- metadata +36 -220
- data/app/overrides/add_google_checkout_to_checkout_edit.rb +0 -9
- data/app/overrides/add_product_added_to_orders_edit.rb +0 -10
- data/app/views/spree/shared/_google_add_items.html.erb +0 -13
- data/app/views/spree/shared/_google_analytics.html.erb +0 -18
- data/app/views/spree/shared/_google_checkout.html.erb +0 -14
- data/app/views/spree/shared/_google_purchase.html.erb +0 -19
- data/app/views/spree/shared/trackers/segment/_product_added.js.erb +0 -9
- data/gemfiles/spree_3_7.gemfile +0 -10
- data/gemfiles/spree_4_0.gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6428462a2ec00ca1334068af805efecf38b751293f86623e818aca577cb7df14
|
4
|
+
data.tar.gz: 1bd89f20f2f4d945ecafa7b843dbcb2a167811858cc7f6e2ab16a3fb59980d27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c42aed4a692ede105d5b39335baa86a02aab94168186a6221dbce0edcb452d15eec696556639834d30c7dfefdca4408c3a9c116f6ea14f171f8520da0953b35e
|
7
|
+
data.tar.gz: d38032fb537f05202f967c7777e30d2ed2f696b2733a39bd20fe560c9ec2e4024f9588dcd9b0a4e1d9ddd30aa2d66712d6aced167e0e7b8948f732529125dc67
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,50 +1,44 @@
|
|
1
|
-
|
2
|
-
dist:
|
1
|
+
os: linux
|
2
|
+
dist: bionic
|
3
|
+
|
4
|
+
addons:
|
5
|
+
apt:
|
6
|
+
sources:
|
7
|
+
- google-chrome
|
8
|
+
packages:
|
9
|
+
- google-chrome-stable
|
10
|
+
|
11
|
+
services:
|
12
|
+
- mysql
|
13
|
+
- postgresql
|
3
14
|
|
4
15
|
language: ruby
|
5
16
|
|
17
|
+
rvm:
|
18
|
+
- 2.5
|
19
|
+
- 2.6
|
20
|
+
|
6
21
|
env:
|
7
|
-
- DB=postgres
|
8
22
|
- DB=mysql
|
9
|
-
|
10
|
-
addons:
|
11
|
-
chrome: stable
|
12
|
-
postgresql: 9.4
|
23
|
+
- DB=postgres
|
13
24
|
|
14
25
|
gemfile:
|
15
|
-
- gemfiles/
|
16
|
-
- gemfiles/spree_3_7.gemfile
|
17
|
-
- gemfiles/spree_4_0.gemfile
|
26
|
+
- gemfiles/spree_4_1.gemfile
|
18
27
|
- gemfiles/spree_master.gemfile
|
19
28
|
|
20
|
-
|
21
|
-
- bundle exec rake test_app
|
22
|
-
- bundle exec rake spec
|
23
|
-
|
24
|
-
rvm:
|
25
|
-
- 2.5.1
|
26
|
-
- 2.4.4
|
27
|
-
- 2.3.8
|
28
|
-
|
29
|
-
matrix:
|
29
|
+
jobs:
|
30
30
|
allow_failures:
|
31
31
|
- gemfile: gemfiles/spree_master.gemfile
|
32
|
-
exclude:
|
33
|
-
- rvm: 2.3.8
|
34
|
-
gemfile: gemfiles/spree_4_0.gemfile
|
35
|
-
- rvm: 2.4.4
|
36
|
-
gemfile: gemfiles/spree_4_0.gemfile
|
37
|
-
- rvm: 2.3.8
|
38
|
-
gemfile: gemfiles/spree_master.gemfile
|
39
|
-
- rvm: 2.4.4
|
40
|
-
gemfile: gemfiles/spree_master.gemfile
|
41
|
-
- rvm: 2.5.1
|
42
|
-
gemfile: gemfiles/spree_3_5.gemfile
|
43
32
|
|
44
33
|
before_install:
|
45
34
|
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
|
46
|
-
|
47
|
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
35
|
+
|
36
|
+
before_script:
|
37
|
+
- CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
|
38
|
+
- CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
|
39
|
+
- curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
|
40
|
+
- unzip chromedriver_linux64.zip -d ~/bin
|
41
|
+
|
42
|
+
script:
|
43
|
+
- bundle exec rake test_app
|
44
|
+
- bundle exec rake spec
|
data/Appraisals
CHANGED
@@ -1,19 +1,6 @@
|
|
1
|
-
appraise 'spree-
|
2
|
-
gem 'spree', '~>
|
3
|
-
gem 'spree_auth_devise', '~>
|
4
|
-
gem 'rails-controller-testing'
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise 'spree-3-7' do
|
8
|
-
gem 'spree', '~> 3.7.0'
|
9
|
-
gem 'spree_auth_devise', '~> 3.5.0'
|
10
|
-
gem 'rails-controller-testing'
|
11
|
-
gem 'sass-rails'
|
12
|
-
end
|
13
|
-
|
14
|
-
appraise 'spree-4-0' do
|
15
|
-
gem 'spree', '~> 4.0.0.beta'
|
16
|
-
gem 'spree_auth_devise', '~> 4.0.0.rc2'
|
1
|
+
appraise 'spree-4-1' do
|
2
|
+
gem 'spree', '~> 4.1.0'
|
3
|
+
gem 'spree_auth_devise', '~> 4.1.0'
|
17
4
|
gem 'rails-controller-testing'
|
18
5
|
end
|
19
6
|
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,7 @@ This extensions adds support for [Google Analytics Enhanced Ecommerce](https://d
|
|
6
6
|
and [Segment Ecommerce](https://segment.com/docs/spec/ecommerce/v2/) tracking to [Spree Commerce](https://spreecommerce.org) stores.
|
7
7
|
|
8
8
|
Via Segment.com you can plug-in also a lot of additional vendors and services like:
|
9
|
+
|
9
10
|
* Mixpanel
|
10
11
|
* Kissmetrics
|
11
12
|
* Google Tag Manager
|
@@ -18,16 +19,19 @@ No additional development required.
|
|
18
19
|
## Installation
|
19
20
|
|
20
21
|
1. Add this extension to your Gemfile with this line:
|
22
|
+
|
21
23
|
```ruby
|
22
|
-
gem 'spree_analytics_trackers', '~>
|
24
|
+
gem 'spree_analytics_trackers', '~> 2.0.0.rc1'
|
23
25
|
```
|
24
26
|
|
25
27
|
2. Install the gem using Bundler:
|
28
|
+
|
26
29
|
```ruby
|
27
30
|
bundle install
|
28
31
|
```
|
29
32
|
|
30
33
|
3. Copy & run migrations
|
34
|
+
|
31
35
|
```ruby
|
32
36
|
bundle exec rails g spree_analytics_trackers:install
|
33
37
|
```
|
@@ -52,10 +56,9 @@ Simply add this require statement to your spec_helper:
|
|
52
56
|
require 'spree_analytics_trackers/factories'
|
53
57
|
```
|
54
58
|
|
55
|
-
|
56
59
|
## License
|
57
60
|
|
58
|
-
Spree Analytics Trackers is copyright © 2017-
|
61
|
+
Spree Analytics Trackers is copyright © 2017-2020
|
59
62
|
[Spark Solutions Sp. z o.o.][spark]. It is free software,
|
60
63
|
and may be redistributed under the terms specified in the
|
61
64
|
[LICENCE](LICENSE) file.
|
@@ -63,6 +66,7 @@ and may be redistributed under the terms specified in the
|
|
63
66
|
[LICENSE]: https://github.com/spree-contrib/spree_analytics_trackers/blob/master/LICENSE
|
64
67
|
|
65
68
|
## About Spark Solutions
|
69
|
+
|
66
70
|
[![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]
|
67
71
|
|
68
72
|
Spree Analytics Trackers is maintained by [Spark Solutions Sp. z o.o.](http://sparksolutions.co?utm_source=github).
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//= require spree/frontend
|
2
|
+
|
3
|
+
function gaAddToCart(variant, quantity) {
|
4
|
+
gtag(
|
5
|
+
'event',
|
6
|
+
'add_to_cart',
|
7
|
+
{
|
8
|
+
id: variant.sku,
|
9
|
+
name: variant.name,
|
10
|
+
category: variant.category,
|
11
|
+
variant: variant.options_text,
|
12
|
+
brand: variant.brand,
|
13
|
+
price: variant.price,
|
14
|
+
quantity: quantity
|
15
|
+
}
|
16
|
+
);
|
17
|
+
}
|
18
|
+
|
19
|
+
function segmentAddtoCart(variant, quantity, currency) {
|
20
|
+
analytics.track('Product Added', {
|
21
|
+
product_id: variant.id,
|
22
|
+
sku: variant.sku,
|
23
|
+
category: variant.category,
|
24
|
+
name: variant.name,
|
25
|
+
brand: variant.brand,
|
26
|
+
price: variant.price,
|
27
|
+
currency: currency,
|
28
|
+
quantity: quantity
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
Spree.ready(function(){
|
33
|
+
$('body').on('product_add_to_cart', function(event) {
|
34
|
+
var variant = event.variant
|
35
|
+
var quantity = event.quantity_increment
|
36
|
+
var currency = event.cart.currency
|
37
|
+
|
38
|
+
if (typeof gtag !== 'undefined') {
|
39
|
+
gaAddToCart(variant, quantity)
|
40
|
+
}
|
41
|
+
|
42
|
+
if (typeof analytics !== 'undefined') {
|
43
|
+
segmentAddtoCart(variant, quantity, currency)
|
44
|
+
}
|
45
|
+
})
|
46
|
+
});
|
@@ -1,11 +1,14 @@
|
|
1
1
|
module SpreeAnalyticsTrackers
|
2
2
|
module StoreControllerDecorator
|
3
|
-
def self.
|
4
|
-
base.
|
3
|
+
def self.included(base)
|
4
|
+
base.include ::Spree::BaseHelper
|
5
|
+
base.include ::Spree::TrackersHelper
|
6
|
+
|
7
|
+
base.helper_method *::Spree::TrackersHelper.public_instance_methods
|
5
8
|
end
|
6
9
|
end
|
7
10
|
end
|
8
11
|
|
9
12
|
if defined?(Spree::StoreController)
|
10
|
-
::Spree::StoreController.
|
13
|
+
::Spree::StoreController.include(::SpreeAnalyticsTrackers::StoreControllerDecorator)
|
11
14
|
end
|
@@ -1,32 +1,70 @@
|
|
1
1
|
module Spree
|
2
2
|
module TrackersHelper
|
3
3
|
def product_for_segment(product, optional = {})
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
cache_key = [
|
5
|
+
'spree-segment-product',
|
6
|
+
I18n.locale,
|
7
|
+
current_currency,
|
8
|
+
product.cache_key_with_version
|
9
|
+
].compact.join('/')
|
10
|
+
|
11
|
+
product_hash = Rails.cache.fetch(cache_key) do
|
12
|
+
{
|
13
|
+
product_id: product.id,
|
14
|
+
sku: product.sku,
|
15
|
+
category: product.category&.name,
|
16
|
+
name: product.name,
|
17
|
+
brand: product.brand&.name,
|
18
|
+
price: product.price_in(current_currency).amount&.to_f,
|
19
|
+
currency: current_currency,
|
20
|
+
url: spree.product_url(product)
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
product_hash.tap do |hash|
|
25
|
+
hash[:image_url] = default_image_for_product_or_variant(product)
|
15
26
|
end.merge(optional).to_json.html_safe
|
16
27
|
end
|
17
28
|
|
18
|
-
|
29
|
+
def ga_line_item(line_item)
|
30
|
+
variant = line_item.variant
|
31
|
+
|
32
|
+
cache_key = [
|
33
|
+
'spree-ga-line-item',
|
34
|
+
I18n.locale,
|
35
|
+
current_currency,
|
36
|
+
line_item.cache_key_with_version,
|
37
|
+
variant.cache_key_with_version
|
38
|
+
].compact.join('/')
|
39
|
+
|
40
|
+
Rails.cache.fetch(cache_key) do
|
41
|
+
product = line_item.product
|
42
|
+
{
|
43
|
+
id: variant.sku,
|
44
|
+
name: variant.name,
|
45
|
+
category: product.category&.name,
|
46
|
+
variant: variant.options_text,
|
47
|
+
brand: product.brand&.name,
|
48
|
+
quantity: line_item.quantity,
|
49
|
+
price: variant.price_in(current_currency).amount&.to_f
|
50
|
+
}.to_json.html_safe
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def filtering_param_present?(param)
|
55
|
+
params.key?(param) && params.fetch(param).present?
|
56
|
+
end
|
19
57
|
|
20
|
-
|
21
|
-
|
22
|
-
|
58
|
+
def any_filtering_params?
|
59
|
+
filtering_params.any? { |p| filtering_param_present?(p) }
|
60
|
+
end
|
23
61
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
request.base_url + asset_url(optional.delete(:image).attachment)
|
62
|
+
def filtering_params_with_values
|
63
|
+
params_with_values = {}
|
64
|
+
filtering_params.each do |param|
|
65
|
+
params_with_values[param] = params.fetch(param) if filtering_param_present?(param)
|
29
66
|
end
|
67
|
+
params_with_values
|
30
68
|
end
|
31
69
|
end
|
32
70
|
end
|
@@ -3,7 +3,7 @@ unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Ver
|
|
3
3
|
Deface::Override.new(
|
4
4
|
virtual_path: 'spree/orders/edit',
|
5
5
|
name: 'add_cart_viewed_to_orders_edit',
|
6
|
-
insert_top:
|
6
|
+
insert_top: '[data-hook="cart_container"]',
|
7
7
|
partial: 'spree/shared/trackers/segment/cart_viewed.js',
|
8
8
|
original: 'e0a3dcdf759c4ec9fad085cd8a5360c8d68167f5'
|
9
9
|
)
|
@@ -2,9 +2,17 @@ spree_version = Gem.loaded_specs['spree_core'].version
|
|
2
2
|
unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Version.create('3.5.0')
|
3
3
|
Deface::Override.new(
|
4
4
|
virtual_path: 'spree/checkout/edit',
|
5
|
-
name: '
|
6
|
-
|
5
|
+
name: 'add_segment_checkout_step_viewed_to_checkout_edit',
|
6
|
+
insert_after: '[data-hook="checkout_content"]',
|
7
7
|
partial: 'spree/shared/trackers/segment/checkout_step_viewed.js',
|
8
|
-
original: '
|
8
|
+
original: '806d2120a1ca1050fb093962fee10363c0944b0a'
|
9
|
+
)
|
10
|
+
|
11
|
+
Deface::Override.new(
|
12
|
+
virtual_path: 'spree/checkout/edit',
|
13
|
+
name: 'add_ga_checkout_step_viewed_to_checkout_edit',
|
14
|
+
insert_after: '[data-hook="checkout_content"]',
|
15
|
+
partial: 'spree/shared/trackers/google_analytics/checkout_step_viewed.js',
|
16
|
+
original: '0ac5c18a2db215bf8ba30470a0e5d69e00d0313a'
|
9
17
|
)
|
10
18
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
spree_version = Gem.loaded_specs['spree_core'].version
|
2
|
+
unless spree_version >= Gem::Version.create('3.3.0') && spree_version < Gem::Version.create('3.5.0') && spree_version != Gem::Version.create('3.5.0.alpha')
|
3
|
+
Deface::Override.new(
|
4
|
+
virtual_path: 'spree/layouts/spree_application',
|
5
|
+
name: 'add_google_analytics_page_viewed_to_spree_application',
|
6
|
+
insert_bottom: "[data-hook='body']",
|
7
|
+
partial: 'spree/shared/trackers/google_analytics/page_viewed.js',
|
8
|
+
original: '6841b819babbe4df1f03d0bc8e05dc81bf0d45ad'
|
9
|
+
)
|
10
|
+
|
11
|
+
Deface::Override.new(
|
12
|
+
virtual_path: 'spree/layouts/checkout',
|
13
|
+
name: 'add_google_analytics_page_viewed_to_spree_checkout',
|
14
|
+
insert_bottom: "[data-hook='body']",
|
15
|
+
partial: 'spree/shared/trackers/google_analytics/page_viewed.js',
|
16
|
+
original: '6841b819babbe4df1f03d0bc8e05dc81bf0d45ad'
|
17
|
+
)
|
18
|
+
end
|
@@ -1,9 +1,17 @@
|
|
1
1
|
if Gem.loaded_specs['spree_core'].version >= Gem::Version.create('3.5.0.alpha')
|
2
2
|
Deface::Override.new(
|
3
3
|
virtual_path: 'spree/layouts/spree_application',
|
4
|
-
name: '
|
5
|
-
insert_top:
|
6
|
-
partial: 'spree/shared/google_analytics',
|
4
|
+
name: 'add_google_analytics_initializer_to_spree_application',
|
5
|
+
insert_top: '[data-hook="inside_head"]',
|
6
|
+
partial: 'spree/shared/trackers/google_analytics/initializer.js',
|
7
7
|
original: 'cfa30a2831d9a41394c03229cd28b3c7eee69585'
|
8
8
|
)
|
9
|
+
|
10
|
+
Deface::Override.new(
|
11
|
+
virtual_path: 'spree/layouts/checkout',
|
12
|
+
name: 'add_google_analytics_initializer_to_spree_checkout',
|
13
|
+
insert_top: '[data-hook="inside_head"]',
|
14
|
+
partial: 'spree/shared/trackers/google_analytics/initializer.js',
|
15
|
+
original: 'ca3d46a134b93856baf937cf2e473da66d9d8efc'
|
16
|
+
)
|
9
17
|
end
|
@@ -3,7 +3,7 @@ if Gem.loaded_specs['spree_core'].version >= Gem::Version.create('3.5.0')
|
|
3
3
|
virtual_path: 'spree/orders/show',
|
4
4
|
name: 'add_google_purchase_to_orders_show',
|
5
5
|
insert_before: "#order_summary",
|
6
|
-
partial: 'spree/shared/
|
6
|
+
partial: 'spree/shared/trackers/google_analytics/purchase.js',
|
7
7
|
original: 'ac7f302922a3c1bb080095296ccc20e42bab2967'
|
8
8
|
)
|
9
9
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
spree_version = Gem.loaded_specs['spree_core'].version
|
2
2
|
unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Version.create('3.5.0')
|
3
3
|
Deface::Override.new(
|
4
|
-
virtual_path: 'spree/taxons/
|
4
|
+
virtual_path: 'spree/taxons/_header',
|
5
5
|
name: 'add_product_list_filtered_to_taxons_show',
|
6
6
|
insert_before: ".taxon-title",
|
7
7
|
original: '2d71d85f4cb141a6ff90264e48915493d6856e9b',
|
@@ -3,7 +3,7 @@ unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Ver
|
|
3
3
|
Deface::Override.new(
|
4
4
|
virtual_path: 'spree/shared/_products',
|
5
5
|
name: 'add_product_list_viewed_to_products_list',
|
6
|
-
insert_before:
|
6
|
+
insert_before: '[data-hook="homepage_products"]',
|
7
7
|
partial: 'spree/shared/trackers/segment/product_list_viewed.js',
|
8
8
|
original: '8b47dddca9dfaaacca3d462459c6c1ef06c09926'
|
9
9
|
)
|
@@ -3,8 +3,8 @@ unless spree_version >= Gem::Version.create('3.4.0') && spree_version < Gem::Ver
|
|
3
3
|
Deface::Override.new(
|
4
4
|
virtual_path: 'spree/products/show',
|
5
5
|
name: 'add_product_viewed_to_products_show',
|
6
|
-
|
6
|
+
insert_bottom: '[data-hook="product_show"]',
|
7
7
|
partial: 'spree/shared/trackers/segment/product_viewed.js',
|
8
|
-
original: '5426c263ccfe477b270b55024abebc77cf951c91'
|
8
|
+
original: '5426c263ccfe477b270b55024abebc77cf951c91'
|
9
9
|
)
|
10
10
|
end
|