minimum_viable_product 0.7.10 → 0.7.11

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: 8e05d598a711e0a078f598f248628f7508af8899
4
- data.tar.gz: b22bae44b37fcca45ded1859fea09c055617579e
3
+ metadata.gz: 052dd97b997df10d0a08c207533e216f22686528
4
+ data.tar.gz: 575e6eec768779dba7feb87449d115482f67a5d6
5
5
  SHA512:
6
- metadata.gz: cdc6857393458e9f62c63b311898dda4dd1d7bc50d7c40b0b6f3195d84fa1966d849c0010b4870e8401876090654cd15eb3bdb74b976343510ad4591d4e7f88d
7
- data.tar.gz: 40e6e9b5462f52c2b75e0f2a82cbd5f37b085d10f69e6986969a8366e231f9cc71c54705a89a013e410281c7deb705280b148940c1a5da894ff755d3a53eb38b
6
+ metadata.gz: 92788cdb51f09af1f218364b3b491d10997145155942816d6d8c558262cc9669965a38c478176a3c67d53c8d3d199329db16adf9f58640cec62ef692fda32562
7
+ data.tar.gz: 98f719ab02285159ae0baad909a5bbb0a38b06a536bfb577ca371752cb5ad7e6adb810ddfab09d783be9f620ca1030edbdfafe22beb77a4cbd2784c227a28fba
data/README.md CHANGED
@@ -25,6 +25,7 @@ SEGMENT_WRITE_KEY=
25
25
  SLACK_WEBHOOK_URL=
26
26
  SLACK_POST_USERNAME=
27
27
  FACEBOOK_TRACKING_ID=
28
+ AMPLITUDE_API_KEY=
28
29
  HOST_DOMAIN=localhost
29
30
  HOST_PORT=3000
30
31
  HOST_PROTOCOL=http
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.10
1
+ 0.7.11
@@ -75,4 +75,26 @@ var _rollbarConfig = {
75
75
  })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
76
76
  </script>
77
77
  <% end %>
78
+
79
+ <% if ENV['AMPLITUDE_API_KEY'] %>
80
+ <script type="text/javascript">
81
+ (function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script");r.type="text/javascript";
82
+ r.async=true;r.src="https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-3.0.1-min.gz.js";
83
+ r.onload=function(){e.amplitude.runQueuedFunctions()};var i=t.getElementsByTagName("script")[0];
84
+ i.parentNode.insertBefore(r,i);function s(e,t){e.prototype[t]=function(){this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
85
+ return this}}var o=function(){this._q=[];return this};var a=["add","append","clearAll","prepend","set","setOnce","unset"];
86
+ for(var u=0;u<a.length;u++){s(o,a[u])}n.Identify=o;var c=function(){this._q=[];return this;
87
+ };var p=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"];
88
+ for(var l=0;l<p.length;l++){s(c,p[l])}n.Revenue=c;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId"];
89
+ function v(e){function t(t){e[t]=function(){e._q.push([t].concat(Array.prototype.slice.call(arguments,0)));
90
+ }}for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){e=(!e||e.length===0?"$default_instance":e).toLowerCase();
91
+ if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]};e.amplitude=n;
92
+ })(window,document);
93
+
94
+ amplitude.getInstance().init("<%= ENV['AMPLITUDE_API_KEY'] %>");
95
+ <% analytics_track_events.each do |event| %>
96
+ amplitude.getInstance().logEvent('<%= event['name'] %>', <%= event['properties'].to_json.html_safe %>);
97
+ <% end %>
98
+ </script>
99
+ <% end %>
78
100
  <% end %>
@@ -1,7 +1,7 @@
1
1
  require('jquery')
2
2
  require('jquery-ujs')
3
3
  require('jquery.cookie')
4
- // var _ = require('lodash')
4
+ var _ = require('lodash')
5
5
  var is = require('is')
6
6
 
7
7
  require('./init/controllers')
@@ -17,13 +17,15 @@ window.track = function(event, attributes, fn){
17
17
  return
18
18
  }
19
19
 
20
- if (typeof(analytics) == 'undefined') {
21
- return
22
- }
23
-
24
- attrs = _.extend({
20
+ let attrs = _.extend({
25
21
  iteration: $('body').data('iteration')
26
22
  }, attributes)
27
23
 
28
- analytics.track(event, attrs, fn)
24
+ if (typeof(analytics) != 'undefined') {
25
+ analytics.track(event, attrs, fn);
26
+ }
27
+
28
+ if (typeof(amplitude) != 'undefined') {
29
+ amplitude.getInstance().logEvent(event, attrs, fn);
30
+ }
29
31
  }
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: minimum_viable_product 0.7.10 ruby lib
5
+ # stub: minimum_viable_product 0.7.11 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "minimum_viable_product"
9
- s.version = "0.7.10"
9
+ s.version = "0.7.11"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Ian Hunter"]
14
- s.date = "2017-02-05"
14
+ s.date = "2017-02-22"
15
15
  s.description = "Built for Developers. Ideal for MVPs, product ideation and validation."
16
16
  s.email = "ianhunter@gmail.com"
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimum_viable_product
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.10
4
+ version: 0.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Hunter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-05 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave