solidus_seo 1.0.13 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/solidus_seo/_facebook.html.erb +37 -35
- data/app/views/solidus_seo/_google-analytics.html.erb +4 -2
- data/app/views/solidus_seo/_google-tag-manager.html.erb +7 -5
- data/app/views/solidus_seo/_pinterest.html.erb +38 -34
- data/lib/solidus_seo/version.rb +1 -1
- data/spec/examples.txt +38 -38
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beb1033fb7f4c045f1f04ea722bcc18b6e2eca0a2d439ccd770405cfe9b2c975
|
4
|
+
data.tar.gz: 9af5e2eccfcd86fe5e1b58ac64753082d7d5ec0554534e0bf4ad58f6575f997c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf61b372e03d5c2e5858771993534722cae657cc7354887454d34cd57f49e439f83afe6678e286f57c9603d5a9cbe22a2c77d4dce3459987962c72287799d3b9
|
7
|
+
data.tar.gz: 13643cee45aef5965a2a1bbe346494f07efd3feb81baea9f9edebb43e045aa915a4430cc900356aad3c36a39b9173cd42389386393a14369bf4b7b883ef3005a
|
@@ -3,42 +3,44 @@ return if ENV['FACEBOOK_PIXEL_ID'].blank?
|
|
3
3
|
|
4
4
|
event_data = {}
|
5
5
|
|
6
|
-
if
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
if order.present?
|
7
|
+
if just_purchased
|
8
|
+
event_data[:order] = {
|
9
|
+
value: order.total,
|
10
|
+
currency: order.currency,
|
11
|
+
content_type: 'product',
|
12
|
+
contents: order.line_items.map do |line_item|
|
13
|
+
{ id: line_item.variant.sku, quantity: line_item.quantity }
|
14
|
+
end,
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
16
|
+
# custom properties
|
17
|
+
order_number: order.number,
|
18
|
+
item_total: order.item_total,
|
19
|
+
tax_total: order.tax_total,
|
20
|
+
ship_total: order.ship_total,
|
21
|
+
promo_total: order.promo_total
|
22
|
+
}
|
23
|
+
end
|
23
24
|
|
24
|
-
if flash[:added_to_cart].present?
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
25
|
+
if flash[:added_to_cart].present?
|
26
|
+
event_data[:added_to_cart] = {
|
27
|
+
currency: order.currency,
|
28
|
+
content_type: 'product',
|
29
|
+
contents: flash[:added_to_cart].map do |variant_sku, variant|
|
30
|
+
{ id: variant_sku, quantity: variant['quantity'] }
|
31
|
+
end
|
32
|
+
}
|
33
|
+
end
|
33
34
|
|
34
|
-
if flash[:checkout_initiated].present?
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
if flash[:checkout_initiated].present?
|
36
|
+
event_data[:checkout_initiated] = {
|
37
|
+
value: order.total,
|
38
|
+
currency: order.currency,
|
39
|
+
contents: order.line_items.map do |line_item|
|
40
|
+
{ id: line_item.variant.sku, quantity: line_item.quantity }
|
41
|
+
end
|
42
|
+
}
|
43
|
+
end
|
42
44
|
end
|
43
45
|
|
44
46
|
if @product
|
@@ -66,8 +68,8 @@ end
|
|
66
68
|
window.solidusSeoDataLayer('facebook', 'addtocart');
|
67
69
|
<% end %>
|
68
70
|
|
69
|
-
<% if event_data[:
|
70
|
-
fbq('track', 'InitiateCheckout', <%== event_data[:
|
71
|
+
<% if event_data[:checkout_initiated].present? %>
|
72
|
+
fbq('track', 'InitiateCheckout', <%== event_data[:checkout_initiated].to_json %>);
|
71
73
|
window.solidusSeoDataLayer('facebook', 'initiatecheckout');
|
72
74
|
<% end %>
|
73
75
|
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<%
|
2
2
|
return if ENV['GOOGLE_TAG_MANAGER_ID'].present? || ENV['GOOGLE_ANALYTICS_ID'].blank?
|
3
3
|
|
4
|
+
event_data = {}
|
5
|
+
|
4
6
|
if just_purchased
|
5
|
-
|
7
|
+
event_data[:order] = {
|
6
8
|
transaction_id: order.number,
|
7
9
|
value: order.total,
|
8
10
|
items: order.line_items.map do |line_item|
|
@@ -33,7 +35,7 @@ end
|
|
33
35
|
|
34
36
|
<% if just_purchased %>
|
35
37
|
<script data-tag="google-analytics">
|
36
|
-
gtag('event', 'purchase', <%==
|
38
|
+
gtag('event', 'purchase', <%== event_data[:order].to_json %>);
|
37
39
|
window.solidusSeoDataLayer('google-analytics', 'purchase');
|
38
40
|
</script>
|
39
41
|
<% end %>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<%
|
2
2
|
return if ENV['GOOGLE_ANALYTICS_ID'].present? || ENV['GOOGLE_TAG_MANAGER_ID'].blank?
|
3
3
|
|
4
|
+
event_data = {}
|
5
|
+
|
4
6
|
if just_purchased
|
5
|
-
|
7
|
+
event_data[:order] = {
|
6
8
|
id: order.number,
|
7
9
|
revenue: order.total,
|
8
|
-
coupon:
|
10
|
+
coupon: order.adjustments.promotion.first&.promotion_code&.value,
|
9
11
|
|
10
12
|
affiliation: current_store.name,
|
11
13
|
currency: order.currency,
|
@@ -13,7 +15,7 @@ if just_purchased
|
|
13
15
|
shipping: order.ship_total
|
14
16
|
}
|
15
17
|
|
16
|
-
|
18
|
+
event_data[:order_contents] = order.line_items.map do |line_item|
|
17
19
|
{
|
18
20
|
id: line_item.variant.sku,
|
19
21
|
name: line_item.variant.name,
|
@@ -31,8 +33,8 @@ end
|
|
31
33
|
window.dataLayer.push({
|
32
34
|
'ecommerce': {
|
33
35
|
'purchase': {
|
34
|
-
'actionField': <%==
|
35
|
-
'products': <%==
|
36
|
+
'actionField': <%== event_data[:order].to_json %>,
|
37
|
+
'products': <%== event_data[:order_contents].to_json %>
|
36
38
|
}
|
37
39
|
}
|
38
40
|
});
|
@@ -8,24 +8,44 @@ if user_email.present?
|
|
8
8
|
em_data = { em: user_email }
|
9
9
|
end
|
10
10
|
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
if order.present?
|
12
|
+
if just_purchased
|
13
|
+
event_data[:order] = {
|
14
|
+
value: order.total,
|
15
|
+
currency: order.currency,
|
16
|
+
order_quantity: order.line_items.sum(&:quantity),
|
17
|
+
line_items: order.line_items.map do |line_item|
|
18
|
+
next unless line_item.variant
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
{
|
21
|
+
product_id: line_item.variant.product.master.sku,
|
22
|
+
product_name: line_item.variant.name,
|
23
|
+
product_variant_id: line_item.variant.sku,
|
24
|
+
product_variant: line_item.variant.options_text,
|
25
|
+
product_quantity: line_item.quantity,
|
26
|
+
product_price: line_item.price
|
27
|
+
}
|
28
|
+
end.compact
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
if flash[:added_to_cart].present?
|
33
|
+
event_data[:added_to_cart] = {
|
34
|
+
value: order.total,
|
35
|
+
currency: order.currency,
|
36
|
+
order_id: order.number,
|
37
|
+
line_items: flash[:added_to_cart].map do |variant_sku, variant|
|
38
|
+
{
|
39
|
+
product_id: variant['id'],
|
40
|
+
product_name: variant['name'],
|
41
|
+
product_variant_id: variant_sku,
|
42
|
+
product_variant: variant['variant'],
|
43
|
+
product_price: variant['price'],
|
44
|
+
product_quantity: variant['quantity']
|
45
|
+
}
|
46
|
+
end
|
47
|
+
}
|
48
|
+
end
|
29
49
|
end
|
30
50
|
|
31
51
|
if @product
|
@@ -39,23 +59,7 @@ if @product
|
|
39
59
|
}
|
40
60
|
end
|
41
61
|
|
42
|
-
|
43
|
-
event_data[:added_to_cart] = {
|
44
|
-
value: order.total,
|
45
|
-
currency: order.currency,
|
46
|
-
order_id: order.number,
|
47
|
-
line_items: flash[:added_to_cart].map do |variant_sku, variant|
|
48
|
-
{
|
49
|
-
product_id: variant['id'],
|
50
|
-
product_name: variant['name'],
|
51
|
-
product_variant_id: variant_sku,
|
52
|
-
product_variant: variant['variant'],
|
53
|
-
product_price: variant['price'],
|
54
|
-
product_quantity: variant['quantity']
|
55
|
-
}
|
56
|
-
end
|
57
|
-
}
|
58
|
-
end
|
62
|
+
|
59
63
|
%>
|
60
64
|
<script type="text/javascript" data-tag="pinterest">
|
61
65
|
!function(e){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var n=window.pintrk;n.queue=[],n.version="3.0";var t=document.createElement("script");t.async=!0,t.src=e;var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js");
|
data/lib/solidus_seo/version.rb
CHANGED
data/spec/examples.txt
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------------------- | ------- | --------------- |
|
3
|
-
./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/features/add_to_cart_spec.rb[1:2:1] | passed |
|
5
|
-
./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.
|
6
|
-
./spec/features/checkout_complete_spec.rb[1:1:1] | passed | 0.
|
7
|
-
./spec/features/checkout_complete_spec.rb[1:2:1] | passed |
|
8
|
-
./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.
|
9
|
-
./spec/features/checkout_complete_spec.rb[1:4:1] | passed |
|
10
|
-
./spec/features/checkout_initiated_spec.rb[1:1:1] | pending |
|
11
|
-
./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.
|
12
|
-
./spec/features/checkout_initiated_spec.rb[1:3:1] | passed |
|
13
|
-
./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.
|
14
|
-
./spec/features/homepage_spec.rb[1:1:1] | passed | 0.
|
15
|
-
./spec/features/homepage_spec.rb[1:1:2] | passed | 0.
|
16
|
-
./spec/features/homepage_spec.rb[1:2:1] | passed | 0.
|
17
|
-
./spec/features/homepage_spec.rb[1:2:2] | passed | 0.
|
18
|
-
./spec/features/homepage_spec.rb[1:3:1] | passed | 0.
|
19
|
-
./spec/features/homepage_spec.rb[1:3:2] | passed | 0.
|
20
|
-
./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.
|
21
|
-
./spec/features/product_page_spec.rb[1:1:1] | passed | 0.
|
22
|
-
./spec/features/product_page_spec.rb[1:1:2] | passed | 0.
|
23
|
-
./spec/features/product_page_spec.rb[1:1:3] | passed | 0.
|
24
|
-
./spec/features/product_page_spec.rb[1:2:1] | passed | 0.
|
25
|
-
./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.
|
26
|
-
./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.
|
27
|
-
./spec/features/product_page_spec.rb[1:3:1] | passed | 0.
|
28
|
-
./spec/features/product_page_spec.rb[1:3:2] | passed | 0.
|
29
|
-
./spec/features/product_page_spec.rb[1:3:3] | passed | 0.
|
30
|
-
./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.
|
31
|
-
./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.
|
32
|
-
./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.
|
33
|
-
./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.
|
34
|
-
./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.
|
35
|
-
./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.
|
36
|
-
./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.
|
37
|
-
./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.
|
38
|
-
./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.
|
39
|
-
./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.
|
40
|
-
./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.
|
3
|
+
./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.88876 seconds |
|
4
|
+
./spec/features/add_to_cart_spec.rb[1:2:1] | passed | 1.67 seconds |
|
5
|
+
./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.81532 seconds |
|
6
|
+
./spec/features/checkout_complete_spec.rb[1:1:1] | passed | 0.49475 seconds |
|
7
|
+
./spec/features/checkout_complete_spec.rb[1:2:1] | passed | 0.63596 seconds |
|
8
|
+
./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.4408 seconds |
|
9
|
+
./spec/features/checkout_complete_spec.rb[1:4:1] | passed | 0.54652 seconds |
|
10
|
+
./spec/features/checkout_initiated_spec.rb[1:1:1] | pending | 1.46 seconds |
|
11
|
+
./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.11918 seconds |
|
12
|
+
./spec/features/checkout_initiated_spec.rb[1:3:1] | passed | 3.12 seconds |
|
13
|
+
./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.1185 seconds |
|
14
|
+
./spec/features/homepage_spec.rb[1:1:1] | passed | 0.26686 seconds |
|
15
|
+
./spec/features/homepage_spec.rb[1:1:2] | passed | 0.31045 seconds |
|
16
|
+
./spec/features/homepage_spec.rb[1:2:1] | passed | 0.36642 seconds |
|
17
|
+
./spec/features/homepage_spec.rb[1:2:2] | passed | 0.29678 seconds |
|
18
|
+
./spec/features/homepage_spec.rb[1:3:1] | passed | 0.29245 seconds |
|
19
|
+
./spec/features/homepage_spec.rb[1:3:2] | passed | 0.2174 seconds |
|
20
|
+
./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.54381 seconds |
|
21
|
+
./spec/features/product_page_spec.rb[1:1:1] | passed | 0.39065 seconds |
|
22
|
+
./spec/features/product_page_spec.rb[1:1:2] | passed | 0.40425 seconds |
|
23
|
+
./spec/features/product_page_spec.rb[1:1:3] | passed | 0.38355 seconds |
|
24
|
+
./spec/features/product_page_spec.rb[1:2:1] | passed | 0.40304 seconds |
|
25
|
+
./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.42235 seconds |
|
26
|
+
./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.39108 seconds |
|
27
|
+
./spec/features/product_page_spec.rb[1:3:1] | passed | 0.38062 seconds |
|
28
|
+
./spec/features/product_page_spec.rb[1:3:2] | passed | 0.37097 seconds |
|
29
|
+
./spec/features/product_page_spec.rb[1:3:3] | passed | 0.34059 seconds |
|
30
|
+
./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.40027 seconds |
|
31
|
+
./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.52408 seconds |
|
32
|
+
./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.40921 seconds |
|
33
|
+
./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.44084 seconds |
|
34
|
+
./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.38952 seconds |
|
35
|
+
./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.3867 seconds |
|
36
|
+
./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.39532 seconds |
|
37
|
+
./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.37653 seconds |
|
38
|
+
./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.36491 seconds |
|
39
|
+
./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.38757 seconds |
|
40
|
+
./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.58312 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_seo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karma Creative
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|