module VWO::Utils::CustomDimensions

Public Instance Methods

get_batch_event_url_params(settings_file, tag_key, tag_value, user_id) click to toggle source
# File lib/vwo/utils/custom_dimensions.rb, line 48
def get_batch_event_url_params(settings_file, tag_key, tag_value, user_id)
  tag = { 'u' => {} }
  tag['u'][tag_key] = tag_value

  account_id = settings_file['accountId']
  params = {
    'eT' => 3,
    't' => JSON.generate(tag),
    'u' => generator_for(user_id, account_id),
    'sId' => get_current_unix_timestamp
  }

  VWO::Logger.get_instance.log(
    LogLevelEnum::DEBUG,
    format(
      LogMessageEnum::DebugMessages::PARAMS_FOR_PUSH_CALL,
      file: FileNameEnum::CustomDimensionsUtil,
      properties: JSON.generate(params)
    )
  )
  params
end
get_url_params(settings_file, tag_key, tag_value, user_id, sdk_key) click to toggle source
# File lib/vwo/utils/custom_dimensions.rb, line 29
def get_url_params(settings_file, tag_key, tag_value, user_id, sdk_key)
  url = HTTPS_PROTOCOL + ENDPOINTS::BASE_URL + ENDPOINTS::PUSH
  tag = { 'u' => {} }
  tag['u'][tag_key] = tag_value

  params = get_common_properties(user_id, settings_file)
  params.merge!('url' => url, 'tags' => JSON.generate(tag), 'env' => sdk_key)

  VWO::Logger.get_instance.log(
    LogLevelEnum::DEBUG,
    format(
      LogMessageEnum::DebugMessages::PARAMS_FOR_PUSH_CALL,
      file: FileNameEnum::CustomDimensionsUtil,
      properties: JSON.generate(params)
    )
  )
  params
end