Skip to content

Kajabi/amplitude-api

 
 

Repository files navigation

Amplitude API

Build Status Code Climate Gem Version

Installation

gem install amplitude-api

Basic Usage

The following code snippet will immediately track an event to the Amplitude API.

# Configure your Amplitude API key
AmplitudeAPI.config.api_key = "abcdef123456"


event = AmplitudeAPI::Event.new({
  user_id: "123",
  event_type: "clicked on home",
  time: Time.now,
  insert_id: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
  event_properties: {
    cause: "button",
    arbitrary: "properties"
  }
})
AmplitudeAPI.track(event)

User Privacy APIs

The following code snippet will delete a user from amplitude

# Configure your Amplitude API key
AmplitudeAPI.config.api_key = "abcdef123456"

# Configure your Amplitude Secret Key
AmplitudeAPI.config.secret_key = "secretMcSecret"

AmplitudeAPI.delete(user_ids: [233],
  requester: "[email protected]"
)

Other useful resources

About

A Ruby library for interacting with the Amplitude API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%