analytics_instrumentation 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2153b9c13c4a12c4f9109c5693ff93d9eaa93a3
|
|
4
|
+
data.tar.gz: 1aba06ff204ae0a490ed954bf447bff1fe282dd3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9243c70c77838a29109126e239682a1266c683a7507134fc7baabac98c924d0cac050d43aa32000b93977cc276813ea858965c4a092da29cc00ee4b769cab89
|
|
7
|
+
data.tar.gz: 3a2cb4247846e20d47d06a2211af12f9387489f219e42113d94681cfa12bf261805851d37cfd11fa0c0c1497525b4eea89c76ccec2c226c3355902c9076e62f9
|
|
@@ -51,11 +51,8 @@ module AnalyticsInstrumentation
|
|
|
51
51
|
session[:last_seen_logged_out] = Time.now
|
|
52
52
|
end
|
|
53
53
|
rescue => e
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
puts @@config.inspect
|
|
57
|
-
puts @@config.error_handler.inspect
|
|
58
|
-
@@config.error_handler(e, "Analytics Check Session Crash: #{request.filtered_path}")
|
|
54
|
+
logger.debug "Errpr found in analyticsCheckSessionStart: #{e.inspect}"
|
|
55
|
+
@@config.error_handler.call(e, "Analytics Check Session Crash: #{request.filtered_path}")
|
|
59
56
|
end
|
|
60
57
|
end
|
|
61
58
|
|
|
@@ -81,7 +78,8 @@ module AnalyticsInstrumentation
|
|
|
81
78
|
properties.merge! analyticsSuperProperties
|
|
82
79
|
analyticsTrackEvent "Page View", properties
|
|
83
80
|
rescue => e
|
|
84
|
-
|
|
81
|
+
logger.debug "Errpr found in analyticsLogPageView: #{e.inspect}"
|
|
82
|
+
@@config.error_handler.call(e, "Analytics Crash: #{request.filtered_path}")
|
|
85
83
|
end
|
|
86
84
|
end
|
|
87
85
|
|
|
@@ -113,9 +111,11 @@ module AnalyticsInstrumentation
|
|
|
113
111
|
def analyticsSetPerson(user)
|
|
114
112
|
return if skip_analytics?
|
|
115
113
|
|
|
114
|
+
user_traits = instance_exec(user, &@@config.custom_user_traits)
|
|
115
|
+
|
|
116
116
|
properties = {
|
|
117
117
|
user_id: user.id,
|
|
118
|
-
traits:
|
|
118
|
+
traits: (user_traits||{})
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
logger.debug "Analytics.identify #{JSON.pretty_generate(properties)}"
|
|
@@ -148,7 +148,10 @@ module AnalyticsInstrumentation
|
|
|
148
148
|
properties["source"] = params[:source] if params[:source]
|
|
149
149
|
|
|
150
150
|
properties.merge! analyticsSuperProperties
|
|
151
|
-
|
|
151
|
+
|
|
152
|
+
# User defined extra props, called in context
|
|
153
|
+
extra_props = instance_exec(&@@config.extra_event_properties)
|
|
154
|
+
properties.merge! (extra_props || {})
|
|
152
155
|
|
|
153
156
|
analyticsApplyOriginatingPage properties
|
|
154
157
|
|
|
@@ -31,14 +31,6 @@ module AnalyticsInstrumentation
|
|
|
31
31
|
self.error_handler = Proc.new { |e, msg=""| raise }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def custom_user_traits(user)
|
|
35
|
-
self.custom_user_traits(user) || {}
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def extra_event_properties
|
|
39
|
-
self.extra_event_properties() || {}
|
|
40
|
-
end
|
|
41
|
-
|
|
42
34
|
def intercom?
|
|
43
35
|
Intercom rescue false
|
|
44
36
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: analytics_instrumentation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jordan Feldstein
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-03-
|
|
12
|
+
date: 2015-03-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|