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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7168e31b5ff42083d503f48cd047c83263948e8e
4
- data.tar.gz: dc4687cdc2b1c5fd9971b15083095856fe3d4c3a
3
+ metadata.gz: e8cdad0d4b1e4982294e3e2e59cbabbc7b4d2071
4
+ data.tar.gz: d0e2aa205de56ed3fa29a02f2c165d23d5fe50e9
5
5
  SHA512:
6
- metadata.gz: 6753e5d4a0bf2ee10ff2236f998e7a01c3c58f8222ee3f441e0dcd0722dba399e9bbb16101d822728501cf05777d74a367421bb1e3c38fd011b76efa286f2987
7
- data.tar.gz: 9c86af5ddb47c489f151ef04897d4eb9d08366c1639c6e201b6572f21de42aefde8c935244fa3e6092c0a12ab3d0e98471134af2429e7c85887c55e231f002dc
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('gtm'), admin_gtms_path %>
2
+ <%= configurations_sidebar_menu_item t('Google Tag Manager'), admin_gtms_path %>
@@ -1,3 +1,4 @@
1
+ <h1> Google Tag Manager</h1>
1
2
  <% if @gtm.errors.any? %>
2
3
  <h2>Errors:</h2>
3
4
  <ul>
@@ -1,4 +1,4 @@
1
- <h1><%= t('spree.gtm') %></h1>
1
+ <h1> Google Tag Manager</h1>
2
2
  <div class="col-md-6">
3
3
  <br />
4
4
  <br />
@@ -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
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_gtm'
5
- s.version = '0.0.4'
5
+ s.version = '0.0.5'
6
6
  s.summary = 'some summary here'
7
7
  s.description = 'some gem description here'
8
8
  s.required_ruby_version = '>= 2.1.0'
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
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-18 00:00:00.000000000 Z
12
+ date: 2016-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core