vwo-fme-ruby-sdk 1.62.0 → 1.65.0

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
  SHA256:
3
- metadata.gz: dcf63d5ca27daa33c6ac23c15291b07d0a201369ffc135b1aee73985a20cf28f
4
- data.tar.gz: '00483da13aa8d2dae20a460b1873551a5a2d7bb7fa327e42f4a1af33ec65a77f'
3
+ metadata.gz: 7eebc3ee7e009946d9836506ffeb38f8cde356652599fc412ca1f4dc149fdbec
4
+ data.tar.gz: 73866cdddfd7f3d6dd2ee37024ef1cf9f379bf51dc76abe7b905c74564834ddb
5
5
  SHA512:
6
- metadata.gz: 46afef335acff1ac4f6306aae303fd5149a1aa0e4658beffd25d5996afa421f7e0f4b4c6c590b31f86c9b2dc03158507e3f2fdcfa39bf9b501516d7f5ceac9a3
7
- data.tar.gz: b9c670fe3cbbd702bedcdf06bd55183ed8b6f4ab3cbacbd17a2c7b17f83efb133a855c6883a82e9220ac41d0907e8cd67d673b60394fc699ff0ee772c8590042
6
+ metadata.gz: 9a33d9fd96ec32ef4c3988c02a315ee37adb4808be3670a0f8f5f96124b20e4c6828ffda5ebad1be1143a517408ed1e4b88c7c96096e338bd172ef74fc4516ec
7
+ data.tar.gz: cf6e44786ab83723cd274cf23549359ccf92a6a492bf0fd9fa36ecdfb259bf22698f42e04f98b55531941333d1287e47c3b9db607af1a0c9adf33536222f22ee
@@ -17,7 +17,7 @@
17
17
  # Define the Constants module
18
18
  module Constants
19
19
  SDK_NAME = 'vwo-fme-ruby-sdk'.freeze
20
- SDK_VERSION = '1.62.0'.freeze
20
+ SDK_VERSION = '1.65.0'.freeze
21
21
 
22
22
  # --- Brand-specific constants ---
23
23
 
@@ -37,12 +37,21 @@ end
37
37
 
38
38
  # Sends a usage stats event to VWO.
39
39
  # @param usage_stats_account_id - The account id for usage stats.
40
- def send_sdk_usage_stats_event(usage_stats_account_id)
40
+ # @param settings_fetch_time [String, nil] Time taken to fetch settings in milliseconds.
41
+ # @param sdk_init_time [String, nil] Time taken to initialize the SDK in milliseconds.
42
+ # @param init_config [Hash, nil] The SDK initialization options.
43
+ def send_sdk_usage_stats_event(usage_stats_account_id, settings_fetch_time = nil, sdk_init_time = nil, init_config = nil)
41
44
  # create query parameters
42
45
  properties = NetworkUtil.get_events_base_properties(EventEnum::USAGE_STATS, nil, nil, true, usage_stats_account_id)
43
46
 
44
47
  # create payload
45
- payload = NetworkUtil.get_sdk_usage_stats_payload_data(EventEnum::USAGE_STATS, usage_stats_account_id)
48
+ payload = NetworkUtil.get_sdk_usage_stats_payload_data(
49
+ EventEnum::USAGE_STATS,
50
+ usage_stats_account_id,
51
+ settings_fetch_time,
52
+ sdk_init_time,
53
+ init_config
54
+ )
46
55
 
47
56
  # check if batching is enabled
48
57
  if BatchEventsQueue.instance
@@ -94,11 +94,10 @@ class NetworkUtil
94
94
  visitor_ip: ip_address || ''
95
95
  }
96
96
 
97
- if !is_usage_stats_event
98
- # set env key for standard sdk events
99
- properties[:env] = SettingsService.instance.sdk_key
100
- else
101
- # set env key for usage stats events
97
+ # env is the sdk key; sent on both init and usage-stats query params
98
+ properties[:env] = SettingsService.instance.sdk_key
99
+
100
+ if is_usage_stats_event
102
101
  properties[:a] = usage_stat_account_id
103
102
  end
104
103
 
@@ -284,12 +283,20 @@ class NetworkUtil
284
283
  # Constructs the payload for usage stats called event.
285
284
  # @param event_name - The name of the event.
286
285
  # @param usage_stats_account_id - The account id for usage stats.
286
+ # @param settings_fetch_time - Time taken to fetch settings in milliseconds.
287
+ # @param sdk_init_time - Time taken to initialize the SDK in milliseconds.
288
+ # @param init_config - The SDK initialization options.
287
289
  # @returns The constructed payload with required fields.
288
- def get_sdk_usage_stats_payload_data(event_name, usage_stats_account_id)
290
+ def get_sdk_usage_stats_payload_data(event_name, usage_stats_account_id, settings_fetch_time = nil, sdk_init_time = nil, init_config = nil)
289
291
  user_id = SettingsService.instance.account_id.to_s + "_" + SettingsService.instance.sdk_key
290
292
  properties = _get_event_base_payload(user_id, event_name, nil, nil, true, usage_stats_account_id)
291
293
  properties[:d][:event][:props][:product] = Constants::PRODUCT_NAME
292
294
  properties[:d][:event][:props][:vwoMeta] = UsageStatsUtil.get_usage_stats
295
+ properties[:d][:event][:props][:data] = {
296
+ "settingsFetchTime": settings_fetch_time,
297
+ "sdkInitTime": sdk_init_time,
298
+ "initConfig": init_config
299
+ }
293
300
  properties
294
301
  end
295
302
 
data/lib/wingify.rb CHANGED
@@ -107,7 +107,12 @@ module Wingify
107
107
  if usage_stats_account_id
108
108
  sampling_service = InternalEventsSamplingService.new
109
109
  if sampling_service.should_send_usage_stats_event(new_instance.settings)
110
- send_sdk_usage_stats_event(usage_stats_account_id)
110
+ send_sdk_usage_stats_event(
111
+ usage_stats_account_id,
112
+ SettingsService.instance.settings_fetch_time,
113
+ time_taken_for_init.to_s,
114
+ new_instance&.options
115
+ )
111
116
  end
112
117
  end
113
118
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vwo-fme-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.62.0
4
+ version: 1.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VWO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-03 00:00:00.000000000 Z
11
+ date: 2026-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuidtools