Skip to content

Commit

Permalink
screen_view id field should only be set if it is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
fblundun committed Jul 28, 2014
1 parent a58c4ae commit 2080818
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/snowplow-tracker/tracker.rb
Expand Up @@ -310,7 +310,10 @@ def track_struct_event(category, action, label=nil, property=nil, value=nil, con
#
Contract String, Maybe[String], Maybe[@@ContextsInput], Maybe[Num] => [Bool, Num]
def track_screen_view(name, id=nil, context=nil, tstamp=nil)
screen_view_properties = {'name' => name, 'id' => id}
screen_view_properties = {'name' => name}
unless id.nil?
screen_view_properties['id'] = id
end
screen_view_schema = "#{@@base_schema_path}/screen_view/#{@@schema_tag}/1-0-0"
event_json = {schema: screen_view_schema, data: screen_view_properties}

Expand Down

0 comments on commit 2080818

Please sign in to comment.