Skip to content

Commit 36fe738

Browse files
authored
Send name of event tags instead of id (#35)
1 parent 176e1b2 commit 36fe738

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lib/optimizely/event_builder.rb

Lines changed: 2 additions & 2 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.
@@ -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,

spec/event_builder_spec.rb

Lines changed: 7 additions & 7 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.
@@ -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: 3 additions & 3 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.
@@ -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)