solidus_multi_domain 1.3.0 → 1.4.0

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: bb3f5dcfd0e9f2e1cd6eb1b6fc001442e04f37d7
4
- data.tar.gz: ccbe9774d8f526ebbeed4b18ee170a3fc6ad9e4a
3
+ metadata.gz: 5a40529d83de05109a1f62a8f96574255905d659
4
+ data.tar.gz: f2874701ba71846ac29025f8f8c190294eb8301b
5
5
  SHA512:
6
- metadata.gz: ff5e70b3ae70fa83bdefc3eff867582ec51bfe15ad61509e9340122c0ab965f11288c01f8dca01f07be317c482b0ac593f4470062951b8f4f6158de1d91a9371
7
- data.tar.gz: 4f86e155a58580fd34b66e65e65a27a8715c7fc06c89ebec5e6c414d476c513b524f767c49e92c49d6c7beb02afe0f79595dc39b2465dfbaa51c7ce6b894d6d5
6
+ metadata.gz: 53e135eb6ac757ab14ee76e649d5a13daac89681b4a83ec486d9fa3e344d8af6a0e21ab66071394ec17fe8c4020df8f799f260ac06755e5f29cac42cf96c443b
7
+ data.tar.gz: c77f5c988453ae129a9a507b52ffa7675a52316f4a18ec81eb88ea2a55b035f0266514ba61eb21ce458f91356b66f7a26a046fafb28b339c69ae04ebb00dd853
data/README.md CHANGED
@@ -40,6 +40,8 @@ Current features:
40
40
 
41
41
  5. Google analytics trackers can be associated with a store.
42
42
 
43
+ Looking for additional information? Checkout out the [wiki](https://github.com/solidusio/solidus_multi_domain/wiki).
44
+
43
45
  Install Instructions
44
46
  --------------------
45
47
 
@@ -1,39 +1,36 @@
1
1
  <% if tracker = current_tracker %>
2
+ <script>
3
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
5
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
6
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
2
7
 
3
- <%= javascript_tag do %>
4
- var _gaq = _gaq || [];
5
- _gaq.push(['_setAccount', '<%= tracker.analytics_id %>']);
6
- _gaq.push(['_trackPageview']);
8
+ ga('create', '<%= tracker.analytics_id %>', 'auto');
9
+ ga('require', 'displayfeatures');
10
+ ga('send', 'pageview');
7
11
 
8
- <% if flash[:commerce_tracking] && @order.present? %>
9
- <%# more info: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce %>
10
- _gaq.push(['_addTrans',
11
- "<%= j @order.number %>",
12
- "<%= tracker.store.name %>",
13
- "<%= @order.total %>",
14
- "<%= @order.adjustments.tax.sum(:amount) %>",
15
- "<%= @order.adjustments.shipping.sum(:amount) %>",
16
- "<%= j @order.bill_address.city %>",
17
- "<%= j @order.bill_address.state_text %>",
18
- "<%= j @order.bill_address.country.name %>"
19
- ]);
12
+ <% if @order && order_just_completed?(@order) %>
13
+ <%# more info: https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce %>
14
+ ga('require', 'ecommerce', 'ecommerce.js');
15
+ ga('ecommerce:addTransaction', {
16
+ 'id': '<%= j @order.number %>', // Transaction ID. Required.
17
+ 'affiliation': '<%= @order.store.name %>', // Affiliation or store name.
18
+ 'revenue': '<%= @order.total %>', // Grand Total.
19
+ 'shipping': '<%= @order.ship_total %>', // Shipping.
20
+ 'tax': '<%= @order.tax_total %>', // Tax.
21
+ 'currency': '<%= @order.currency %>' // local currency code.
22
+ });
20
23
  <% @order.line_items.each do |line_item| %>
21
- _gaq.push(['_addItem',
22
- "<%= j @order.number %>",
23
- "<%= j line_item.variant.sku %>",
24
- "<%= j line_item.variant.product.name %>",
25
- "",
26
- "<%= line_item.price %>",
27
- "<%= line_item.quantity %>"
28
- ]);
24
+ ga('ecommerce:addItem', {
25
+ 'id': '<%= j @order.number %>', // Transaction ID. Required.
26
+ 'name': '<%= j line_item.variant.product.name %>', // Product name. Required.
27
+ 'sku': '<%= j (line_item.variant.sku || line_item.variant_id) %>', // SKU/code.
28
+ 'category': '', // Category or variation.
29
+ 'price': '<%= line_item.price %>', // Unit price.
30
+ 'quantity': '<%= line_item.quantity %>' // Quantity.
31
+ });
29
32
  <% end %>
30
- _gaq.push(['_trackTrans']);
33
+ ga('ecommerce:send');
31
34
  <% end %>
32
-
33
- (function() {
34
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
35
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
36
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
37
- })();
38
- <% end %>
35
+ </script>
39
36
  <% end %>
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = "solidus_multi_domain"
6
- s.version = "1.3.0"
6
+ s.version = "1.4.0"
7
7
  s.summary = "Adds multiple site support to Solidus"
8
8
  s.description = "Multiple Solidus stores on different domains - single unified backed for processing orders."
9
9
  s.required_ruby_version = ">= 2.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_multi_domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus
@@ -193,7 +193,6 @@ files:
193
193
  - app/views/spree/shared/_google_analytics.html.erb
194
194
  - app/views/spree/shared/_multi_domain_sidebar_entry.html.erb
195
195
  - bin/rails
196
- - circle.yml
197
196
  - config/locales/en.yml
198
197
  - config/locales/fr.yml
199
198
  - config/locales/pl.yml
data/circle.yml DELETED
@@ -1,6 +0,0 @@
1
- machine:
2
- ruby:
3
- version: 2.1.5
4
- test:
5
- pre:
6
- - bundle exec rake test_app