path-reporting 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +2 -1
- data/lib/path/reporting/analytics/amplitude.rb +2 -1
- data/lib/path/reporting/analytics.rb +9 -4
- data/lib/path/reporting/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83b53df4a624786f16884bddfce3a5a0fc7a60302b439c38f6750ee045623a1f
|
4
|
+
data.tar.gz: 573ba359350f8aea458c2581efdf3ae40e2def8e3e62e2afd20f182268b1fbfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd4df58252304ce9356b27c9ccaf5708161369f5b7268959fd66b1ee3d5efd5b7ca277b7d9a8b42ad460fb343a0af22134b4eaecaef03c0349963b02f7ce367
|
7
|
+
data.tar.gz: 2525ed224a1821ba63762d1f01695cf7cb28644eac535f9b153b1024f59d701e183d5c5cb91ddf2954915ce3d5dce1a50d64297dc691e23c589cb255ee4b82ca
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -86,11 +86,12 @@ module Path
|
|
86
86
|
metadata[:system_name] = config.system_name
|
87
87
|
|
88
88
|
event_props = {
|
89
|
-
user_id: (user[:id] || user["id"]).to_s,
|
90
89
|
user_properties: scrub_pii(user),
|
91
90
|
event_type: name,
|
92
91
|
event_properties: scrub_pii(metadata)
|
93
92
|
}
|
93
|
+
event_props[:user_id] = (user[:id] || user["id"]).to_s unless (user[:id] || user["id"]).nil?
|
94
|
+
event_props[:device_id] = (user[:device_id] || user["device_id"]).to_s unless (user[:device_id] || user["device_id"]).nil?
|
94
95
|
API_METADATA_TO_ELEVATE.each do |key|
|
95
96
|
event_props[key] = metadata[key] if metadata.key? key
|
96
97
|
end
|
@@ -115,6 +115,8 @@ module Path
|
|
115
115
|
# recoreded (e.g. a page view, or an interaction).
|
116
116
|
# @param metadata [Hash] Metadata to report alongside the analytics event.
|
117
117
|
# **This should not contain any PII or PHI*
|
118
|
+
# @param use_raw_event_name [boolean] If true, uses just name for the event name.
|
119
|
+
# Otherwise it will be formated to code_area_name
|
118
120
|
#
|
119
121
|
# @example
|
120
122
|
# PathReporting.analytics.record(
|
@@ -154,23 +156,26 @@ module Path
|
|
154
156
|
# @see Reporting::UserType
|
155
157
|
# @see Reporting::Trigger
|
156
158
|
def record(
|
157
|
-
product_code:,
|
158
|
-
product_area:,
|
159
159
|
name:,
|
160
160
|
user:,
|
161
|
+
product_code: "",
|
162
|
+
product_area: "",
|
161
163
|
user_type: UserType::PATIENT,
|
162
164
|
trigger: Trigger::INTERACTION,
|
163
|
-
metadata: {}
|
165
|
+
metadata: {},
|
166
|
+
use_raw_event_name: false
|
164
167
|
)
|
165
168
|
raise Error, "No user hash provided when reporting analytics" if !user.is_a?(Hash) || !(user[:id] || user["id"] || user[:device_id] || user["device_id"])
|
166
169
|
raise Error, "Invalid UserType #{user_type}" unless UserType.valid?(user_type)
|
167
170
|
raise Error, "Invalid Trigger #{trigger}" unless Trigger.valid?(trigger)
|
168
171
|
|
172
|
+
full_name = use_raw_event_name ? name : format_event_name(product_code: product_code, product_area: product_area, name: name)
|
173
|
+
|
169
174
|
clients.map do |reporter, client|
|
170
175
|
{
|
171
176
|
reporter: reporter.to_s,
|
172
177
|
result: send_event_to_client(client, {
|
173
|
-
name:
|
178
|
+
name: full_name,
|
174
179
|
user: user,
|
175
180
|
user_type: user_type,
|
176
181
|
metadata: metadata,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: path-reporting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Hushbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amplitude-api
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.2.32
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Reporting gem for Path Mental Health
|