spree_google_analytics 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/.gitkeep +0 -0
- data/app/controllers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/serializers/.gitkeep +0 -0
- data/app/services/.gitkeep +0 -0
- data/app/views/spree_google_analytics/_cart.html.erb +18 -16
- data/app/views/spree_google_analytics/_checkout_complete.html.erb +4 -4
- data/app/views/spree_google_analytics/_head.html.erb +15 -21
- data/app/views/spree_google_analytics/_product.html.erb +13 -11
- data/lib/spree_google_analytics/version.rb +1 -1
- data/vendor/javascript/.keep +0 -0
- data/vendor/stylesheets/.keep +0 -0
- metadata +16 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f574ee77e62895d03183585199dc5f72802b17f5660343f75fedb32396d334ac
|
|
4
|
+
data.tar.gz: 1a02a1876b8b2b9cac0ab49b1b3b4734a9351eea64375cd4594913978efbea08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1c7831cb5e64a64cf09c3b2b225994308ff47911e02362d69e0f68a18e091c3575f391c1f08e9afb9bfba39499fb142bac68e585f2dee95f72f0e18bcaad50b
|
|
7
|
+
data.tar.gz: 4ee2bb04fef77fa6b25f8d1236075890f30b563b141bfc5d8e940690dad099d0f6e15eb6f0b3c299fee464d92d5f0b3c3ce76e04de8be56f896363aebee97406
|
data/app/.gitkeep
ADDED
|
File without changes
|
|
File without changes
|
data/app/models/.gitkeep
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
<% if store_integration('google_analytics').present? %>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<% if
|
|
5
|
-
if
|
|
6
|
-
window.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
window.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
<% cache [spree_base_cache_key, 'google_analytics_cart', @order].compact do %>
|
|
3
|
+
<script>
|
|
4
|
+
<% if @order.present? && @line_items.any? %>
|
|
5
|
+
<% if use_gtm? %>
|
|
6
|
+
if (window.dataLayer) {
|
|
7
|
+
window.addEventListener('slideover:open', () => {
|
|
8
|
+
dataLayer.push(<%= google_analytics_view_cart_json %>);
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
<% else %>
|
|
12
|
+
if (window.gtag) {
|
|
13
|
+
window.addEventListener('slideover:open', () => {
|
|
14
|
+
gtag('event', 'view_cart', <%= google_analytics_view_cart_json %>);
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
<% end %>
|
|
16
18
|
<% end %>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
</script>
|
|
20
|
+
<% end %>
|
|
19
21
|
<% end %>
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<% safely do %>
|
|
4
4
|
<% if use_gtm? %>
|
|
5
5
|
if (window.dataLayer) {
|
|
6
|
-
<% if @order.user.present? %>
|
|
6
|
+
<% if @order.user.present? && !try_spree_current_user %>
|
|
7
7
|
dataLayer.push({
|
|
8
|
-
user_id: "<%= @order.
|
|
8
|
+
user_id: "<%= @order.user_id %>",
|
|
9
9
|
user_properties: <%= google_analytics_user_properties_json(@order.user) %>
|
|
10
10
|
});
|
|
11
11
|
<% end %>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
<% else %>
|
|
17
17
|
if (window.gtag) {
|
|
18
|
-
<% if @order.user.present? %>
|
|
19
|
-
gtag('set', 'user_id', "<%= @order.
|
|
18
|
+
<% if @order.user.present? && !try_spree_current_user %>
|
|
19
|
+
gtag('set', 'user_id', "<%= @order.user_id %>");
|
|
20
20
|
gtag('set', 'user_properties', <%= google_analytics_user_properties_json(@order.user) %>);
|
|
21
21
|
<% end %>
|
|
22
22
|
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<% integration = store_integration('google_analytics') %>
|
|
2
|
+
|
|
3
|
+
<% if integration.present? %>
|
|
2
4
|
<% if use_gtm? %>
|
|
3
5
|
<!-- Google Tag Manager -->
|
|
4
6
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
5
7
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
6
8
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
7
9
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
8
|
-
})(window,document,'script','dataLayer','<%=
|
|
10
|
+
})(window,document,'script','dataLayer','<%= integration.preferred_google_tag_manager_id %>');</script>
|
|
9
11
|
<!-- End Google Tag Manager -->
|
|
10
12
|
|
|
11
13
|
<script>
|
|
12
14
|
window.dataLayer = window.dataLayer || [];
|
|
13
15
|
|
|
14
16
|
<% if try_spree_current_user %>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
<% cache try_spree_current_user, expires_in: 1.hour do %>
|
|
18
|
+
dataLayer.push({
|
|
19
|
+
user_id: "<%= try_spree_current_user.id %>",
|
|
20
|
+
user_properties: <%= google_analytics_user_properties_json(try_spree_current_user) %>
|
|
21
|
+
});
|
|
22
|
+
<% end %>
|
|
19
23
|
<% end %>
|
|
20
24
|
</script>
|
|
21
25
|
<% else %>
|
|
@@ -25,20 +29,8 @@
|
|
|
25
29
|
window.dataLayer = window.dataLayer || [];
|
|
26
30
|
function gtag(){dataLayer.push(arguments);}
|
|
27
31
|
|
|
28
|
-
<% if defined?(store_integration('cookie_first')) && store_integration('cookie_first').present? %>
|
|
29
|
-
gtag('consent', 'default', {
|
|
30
|
-
'ad_storage': 'denied',
|
|
31
|
-
'ad_user_data': 'denied',
|
|
32
|
-
'ad_personalization': 'denied',
|
|
33
|
-
'analytics_storage': 'denied',
|
|
34
|
-
'functionality_storage': 'denied',
|
|
35
|
-
'security_storage': 'granted',
|
|
36
|
-
'wait_for_update': 2000
|
|
37
|
-
});
|
|
38
|
-
<% end %>
|
|
39
|
-
|
|
40
32
|
gtag('js', new Date());
|
|
41
|
-
GA_MEASUREMENT_ID = "<%=
|
|
33
|
+
GA_MEASUREMENT_ID = "<%= integration.preferred_measurement_id %>";
|
|
42
34
|
|
|
43
35
|
<% if ENV['GA_DEBUG_MODE'].present? %>
|
|
44
36
|
gtag('config', GA_MEASUREMENT_ID, { "debug_mode": true });
|
|
@@ -47,8 +39,10 @@
|
|
|
47
39
|
<% end %>
|
|
48
40
|
|
|
49
41
|
<% if try_spree_current_user %>
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
<% cache try_spree_current_user, expires_in: 1.hour do %>
|
|
43
|
+
gtag('set', 'user_id', "<%= try_spree_current_user.id %>");
|
|
44
|
+
gtag('set', 'user_properties', <%= google_analytics_user_properties_json(try_spree_current_user) %>);
|
|
45
|
+
<% end %>
|
|
52
46
|
<% end %>
|
|
53
47
|
</script>
|
|
54
48
|
<% end %>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<% if store_integration('google_analytics').present? %>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if
|
|
5
|
-
dataLayer
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
gtag
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<% cache [spree_base_cache_key, @product, @selected_variant].compact do %>
|
|
3
|
+
<script>
|
|
4
|
+
<% if use_gtm? %>
|
|
5
|
+
if (window.dataLayer) {
|
|
6
|
+
dataLayer.push(<%= google_analytics_view_item_json %>);
|
|
7
|
+
}
|
|
8
|
+
<% else %>
|
|
9
|
+
if (window.gtag) {
|
|
10
|
+
gtag('event', 'view_item', <%= google_analytics_view_item_json %>);
|
|
11
|
+
}
|
|
12
|
+
<% end %>
|
|
13
|
+
</script>
|
|
14
|
+
<% end %>
|
|
13
15
|
<% end %>
|
|
File without changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_google_analytics
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vendo Connect Inc.
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: spree
|
|
@@ -16,42 +15,42 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 5.1.0
|
|
18
|
+
version: 5.1.0
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 5.1.0
|
|
25
|
+
version: 5.1.0
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: spree_storefront
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
30
|
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 5.1.0
|
|
32
|
+
version: 5.1.0
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 5.1.0
|
|
39
|
+
version: 5.1.0
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
41
|
name: spree_admin
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
44
|
- - ">="
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 5.1.0
|
|
46
|
+
version: 5.1.0
|
|
48
47
|
type: :runtime
|
|
49
48
|
prerelease: false
|
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
50
|
requirements:
|
|
52
51
|
- - ">="
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 5.1.0
|
|
53
|
+
version: 5.1.0
|
|
55
54
|
- !ruby/object:Gem::Dependency
|
|
56
55
|
name: spree_extension
|
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +65,6 @@ dependencies:
|
|
|
66
65
|
- - ">="
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
67
|
version: '0'
|
|
69
|
-
description:
|
|
70
68
|
email: hello@spreecommerce.org
|
|
71
69
|
executables: []
|
|
72
70
|
extensions: []
|
|
@@ -75,17 +73,22 @@ files:
|
|
|
75
73
|
- LICENSE.md
|
|
76
74
|
- README.md
|
|
77
75
|
- Rakefile
|
|
76
|
+
- app/.gitkeep
|
|
78
77
|
- app/assets/config/spree_google_analytics_manifest.js
|
|
79
78
|
- app/assets/images/integration_icons/google-analytics-logo.png
|
|
79
|
+
- app/controllers/.gitkeep
|
|
80
80
|
- app/controllers/spree_google_analytics/store_controller_decorator.rb
|
|
81
81
|
- app/helpers/spree_google_analytics/base_helper.rb
|
|
82
82
|
- app/javascript/spree_google_analytics/application.js
|
|
83
83
|
- app/javascript/spree_google_analytics/controllers/spree_google_analytics_controller.js
|
|
84
|
+
- app/models/.gitkeep
|
|
84
85
|
- app/models/spree/integrations/google_analytics.rb
|
|
85
86
|
- app/presenters/spree_google_analytics/checkout_presenter.rb
|
|
86
87
|
- app/presenters/spree_google_analytics/order_presenter.rb
|
|
87
88
|
- app/presenters/spree_google_analytics/payment_presenter.rb
|
|
88
89
|
- app/presenters/spree_google_analytics/product_presenter.rb
|
|
90
|
+
- app/serializers/.gitkeep
|
|
91
|
+
- app/services/.gitkeep
|
|
89
92
|
- app/views/spree/admin/integrations/forms/_google_analytics.html.erb
|
|
90
93
|
- app/views/spree_google_analytics/_add_to_cart.html.erb
|
|
91
94
|
- app/views/spree_google_analytics/_add_to_wishlist.erb
|
|
@@ -107,11 +110,12 @@ files:
|
|
|
107
110
|
- lib/spree_google_analytics/factories.rb
|
|
108
111
|
- lib/spree_google_analytics/testing_support/factories/google_analytics_integration.rb
|
|
109
112
|
- lib/spree_google_analytics/version.rb
|
|
113
|
+
- vendor/javascript/.keep
|
|
114
|
+
- vendor/stylesheets/.keep
|
|
110
115
|
homepage: https://github.com/spree/spree_google_analytics
|
|
111
116
|
licenses:
|
|
112
117
|
- AGPL-3.0-or-later
|
|
113
118
|
metadata: {}
|
|
114
|
-
post_install_message:
|
|
115
119
|
rdoc_options: []
|
|
116
120
|
require_paths:
|
|
117
121
|
- lib
|
|
@@ -127,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
131
|
version: '0'
|
|
128
132
|
requirements:
|
|
129
133
|
- none
|
|
130
|
-
rubygems_version:
|
|
131
|
-
signing_key:
|
|
134
|
+
rubygems_version: 4.0.2
|
|
132
135
|
specification_version: 4
|
|
133
136
|
summary: Spree Commerce Google analytics Extension
|
|
134
137
|
test_files: []
|