Sha256: bf5eefc704a140b4e51c90d2cf80d12fc809c740752e783917d3a2191451c6c3

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

require 'rudder_analytics_sync'

include RudderAnalyticsSync

analytics = RudderAnalyticsSync::Client.new(
  write_key: '1aJDXU7xlQpUp6qW1ppTJTvkgSi', # required
  data_plane_url: 'https://86143ed0.ngrok.io',
  stub: true,
  on_error: proc { |error_code, error_body, exception, response|
    # defaults to an empty proc
  }
)

# analytics.track(
#   user_id: 'test_user_id',
#   event: 'Created Account'
# )

analytics.batch do |batch|
  batch.context = { source: "test"}
  batch.integrations = { All: false, S3: true }
  batch.track({ event: "test" })
  batch.identify({ user_id: "test" })
  batch.screen({ user_id: "test", name: 'test'})
  batch.page({ user_id: "test", name: 'test'})
  batch.alias({ user_id: "test", previous_id: 'test'})
  batch.group({ group_id: "test" })
  # batch.track(
  #   user_id: 'test_user_id',
  #   event: 'Created Account'
  # )
  # batch.page(
  #   user_id: 'test_user_id',
  #   name: 'Created Account',
  #   properties: {
  #     k1: 'v1'
  #   }
  # )
  # batch.track(
  #   user_id: 'test_user_id',
  #   event: 'Closed Account'
  # )
  # batch.identify(
  #   user_id: 'test_user_id_1',
  #   traits: {
  #     name: 'test'
  #   }
  # )
  # batch.group(
  #   user_id: 'test_user_id',
  #   group_id: 'group_id'
  # )
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rudder_analytics_sync-1.0.7 example/example.rb
rudder_analytics_sync-1.0.6 example/example.rb
rudder_analytics_sync-1.0.5 example/example.rb
rudder_analytics_sync-1.0.4 example/example.rb
rudder_analytics_sync-1.0.3 example/example.rb