spree_gtm 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_gtm_to_admin_configurations_sidebar_menu.html.erb.deface +1 -1
- data/app/views/spree/admin/gtms/edit.html.erb +1 -0
- data/app/views/spree/admin/gtms/index.html.erb +1 -1
- data/app/views/spree/gtm/_google_tag_manager_body.html.erb +22 -0
- data/spree_gtm.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8cdad0d4b1e4982294e3e2e59cbabbc7b4d2071
|
4
|
+
data.tar.gz: d0e2aa205de56ed3fa29a02f2c165d23d5fe50e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52922bb24cbc84b96a3ce202679af936625c021913bbd5bcd34db62ff7c3a3e14358b1c97ae526b10a122942ad2f4d0f39dc8f500c9590cb2b269f4d438a5016
|
7
|
+
data.tar.gz: 9d03e4190df36827b975178d99c3456d6298239ddd4cdc226d2bdda9aa3c1c17892ec6152e03f55f6c79f343ecba2fe61236642ad909a700d5f4b991a171d237
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<!-- insert_bottom "[data-hook='admin_configurations_sidebar_menu']" -->
|
2
|
-
<%= configurations_sidebar_menu_item t('
|
2
|
+
<%= configurations_sidebar_menu_item t('Google Tag Manager'), admin_gtms_path %>
|
@@ -1,4 +1,26 @@
|
|
1
1
|
<% if Spree::Gtm.activated? %>
|
2
|
+
<% if controller.controller_name == "orders" && controller.action_name == "show" %>
|
3
|
+
<script>
|
4
|
+
window.dataLayer = window.dataLayer || [];
|
5
|
+
dataLayer.push({
|
6
|
+
'transactionId': '<%= @order.number %>',
|
7
|
+
'transactionTotal': <%= @order.total %>,
|
8
|
+
'transactionTax': <%= @order.adjustments.tax.sum(:amount) %>,
|
9
|
+
'transactionShipping': <%= @order.adjustments.shipping.sum(:amount) %>,
|
10
|
+
'transactionCity': '<%= @order.bill_address.city %>',
|
11
|
+
'transactionState': '<%= @order.bill_address.state_text %>',
|
12
|
+
'transactionZip': '<%= @order.bill_address.zipcode %>',
|
13
|
+
'transactionEmail': '<%= @order.email %>',
|
14
|
+
'transactionProducts': [
|
15
|
+
<%=raw @order.line_items.map { |line_item| "{ 'sku': '#{h line_item.variant.sku}',
|
16
|
+
'name': '#{h line_item.variant.product.name}',
|
17
|
+
'category': '',
|
18
|
+
'price': #{h line_item.price},
|
19
|
+
'quantity': #{h line_item.quantity}}" } .join(",") %>
|
20
|
+
]
|
21
|
+
});
|
22
|
+
</script>
|
23
|
+
<% end %>
|
2
24
|
<!-- Google Tag Manager (noscript) -->
|
3
25
|
<noscript>
|
4
26
|
<iframe src="//www.googletagmanager.com/ns.html?id=<%= Spree::Gtm.gtm_accountid %>"
|
data/spree_gtm.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_gtm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav O. Pogrebnyak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|