Skip to content

Commit ed00e31

Browse files
authored
Release v1.1.2
Send name of event tags instead of event ID. Update URL endpoint to the log server.
2 parents 2ccc941 + c6c9fc7 commit ed00e31

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------------------
2+
1.1.2
3+
* Send name of event tags instead of event ID.
4+
* Update URL endpoint to the log server.
5+
-------------------------------------------------------------------------------
6+
17
-------------------------------------------------------------------------------
28
1.1.1
39
* Gracefully handle empty traffic allocation ranges.

lib/optimizely/event_builder.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2016, Optimizely and contributors
2+
# Copyright 2016-2017, Optimizely and contributors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -69,8 +69,8 @@ def add_common_params(user_id, attributes)
6969
end
7070

7171
class EventBuilderV2 < BaseEventBuilder
72-
CONVERSION_EVENT_ENDPOINT = 'https://p13nlog.dz.optimizely.com/log/event'
73-
IMPRESSION_EVENT_ENDPOINT = 'https://p13nlog.dz.optimizely.com/log/decision'
72+
CONVERSION_EVENT_ENDPOINT = 'https://logx.optimizely.com/log/event'
73+
IMPRESSION_EVENT_ENDPOINT = 'https://logx.optimizely.com/log/decision'
7474
POST_HEADERS = { 'Content-Type' => 'application/json' }
7575

7676
def create_impression_event(experiment_key, variation_id, user_id, attributes)
@@ -173,7 +173,7 @@ def add_event_tags(event_tags)
173173
next if event_tag_value.nil?
174174

175175
event_feature = {
176-
'id' => event_tag_key,
176+
'name' => event_tag_key,
177177
'type' => 'custom',
178178
'value' => event_tag_value,
179179
'shouldIndex' => false,

lib/optimizely/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# limitations under the License.
1515
#
1616
module Optimizely
17-
VERSION = '1.1.1'.freeze
17+
VERSION = '1.1.2'.freeze
1818
end

spec/event_builder_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2016, Optimizely and contributors
2+
# Copyright 2016-2017, Optimizely and contributors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
3535
time_now = Time.now
3636
allow(Time).to receive(:now).and_return(time_now)
3737

38-
@expected_impression_url = 'https://p13nlog.dz.optimizely.com/log/decision'
38+
@expected_impression_url = 'https://logx.optimizely.com/log/decision'
3939
@expected_impression_params = {
4040
'visitorId' => 'test_user',
4141
'timestamp' => (time_now.to_f * 1000).to_i,
@@ -53,7 +53,7 @@
5353
'userFeatures' => [],
5454
}
5555

56-
@expected_conversion_url = 'https://p13nlog.dz.optimizely.com/log/event'
56+
@expected_conversion_url = 'https://logx.optimizely.com/log/event'
5757
@expected_conversion_params = {
5858
'visitorId' => 'test_user',
5959
'timestamp' => (time_now.to_f * 1000).to_i,
@@ -130,7 +130,7 @@
130130
}]
131131
@expected_conversion_params['eventFeatures'] = [
132132
{
133-
'id' => 'revenue',
133+
'name' => 'revenue',
134134
'type' => 'custom',
135135
'value' => 4200,
136136
'shouldIndex' => false
@@ -149,7 +149,7 @@
149149
@expected_conversion_params['eventMetrics'] = []
150150
@expected_conversion_params['eventFeatures'] = [
151151
{
152-
'id' => 'revenue',
152+
'name' => 'revenue',
153153
'type' => 'custom',
154154
'value' => "4200",
155155
'shouldIndex' => false
@@ -167,7 +167,7 @@
167167
it 'should create a valid V2 Event when create_conversion_event is called with boolean event tag' do
168168
@expected_conversion_params['eventFeatures'] = [
169169
{
170-
'id' => 'boolean_tag',
170+
'name' => 'boolean_tag',
171171
'type' => 'custom',
172172
'value' => false,
173173
'shouldIndex' => false
@@ -188,7 +188,7 @@
188188
it 'should create a valid V2 Event when create_conversion_event is called with string event tag' do
189189
@expected_conversion_params['eventFeatures'] = [
190190
{
191-
'id' => 'string_tag',
191+
'name' => 'string_tag',
192192
'type' => 'custom',
193193
'value' => 'iamstring',
194194
'shouldIndex' => false
@@ -208,7 +208,7 @@
208208
it 'should create a valid V2 Event when create_conversion_event is called with integer event tag' do
209209
@expected_conversion_params['eventFeatures'] = [
210210
{
211-
'id' => 'integer_tag',
211+
'name' => 'integer_tag',
212212
'type' => 'custom',
213213
'value' => 42,
214214
'shouldIndex' => false
@@ -228,7 +228,7 @@
228228
it 'should create a valid V2 Event when create_conversion_event is called with float event tag' do
229229
@expected_conversion_params['eventFeatures'] = [
230230
{
231-
'id' => 'float_tag',
231+
'name' => 'float_tag',
232232
'type' => 'custom',
233233
'value' => 42.01,
234234
'shouldIndex' => false

spec/project_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2016, Optimizely and contributors
2+
# Copyright 2016-2017, Optimizely and contributors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -412,8 +412,8 @@ class InvalidErrorHandler; end
412412
let(:error_handler) { Optimizely::RaiseErrorHandler.new }
413413
let(:spy_logger) { spy('logger') }
414414
let(:version) { Optimizely::VERSION }
415-
let(:impression_log_url) { 'https://p13nlog.dz.optimizely.com/log/decision' }
416-
let(:conversion_log_url) { 'https://p13nlog.dz.optimizely.com/log/event' }
415+
let(:impression_log_url) { 'https://logx.optimizely.com/log/decision' }
416+
let(:conversion_log_url) { 'https://logx.optimizely.com/log/event' }
417417
let(:project_instance) { Optimizely::Project.new(config_body_JSON, nil, spy_logger, error_handler) }
418418
let(:time_now) { Time.now }
419419
let(:post_headers) { { 'Content-Type' => 'application/json' } }
@@ -711,7 +711,7 @@ class InvalidErrorHandler; end
711711
'eventEntityId' => '111095',
712712
'eventFeatures' => [
713713
{
714-
'id' => 'revenue',
714+
'name' => 'revenue',
715715
'type' => 'custom',
716716
'value' => 42,
717717
'shouldIndex' => false
@@ -808,7 +808,7 @@ class InvalidErrorHandler; end
808808
'eventName' => 'test_event',
809809
'eventFeatures' => [
810810
{
811-
'id' => 'revenue',
811+
'name' => 'revenue',
812812
'type' => 'custom',
813813
'value' => 42,
814814
'shouldIndex' => false

0 commit comments

Comments
 (0)