Git Product home page Git Product logo

amplitude-api's People

Contributors

alvaromaceda avatar avokhmin avatar dependabot[bot] avatar fcukit avatar gildasdarex avatar iabdulin avatar itamar avatar ixti avatar jonduarte avatar krettan avatar samjohn avatar shaliko avatar toothrot avatar tyler-eon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amplitude-api's Issues

Unable to see events

Hi,

I've set this up, and it appears AmplitudeAPI.config.api_key = ... doesn't exist, but this works: AmplitudeAPI.api_key = ....
But now I send events but I can't see them on the dashboard. Any idea?

Exception thrown when calling Track

Hi,

I'm getting an exception when calling AmplitudeAPI.track. Here's what I got:

NoMethodError: undefined method `to_h' for []:Array
/Users/abcd/.rvm/gems/ruby-2.0.0-p648/bundler/gems/amplitude-api-40903ce133aa/lib/amplitude_api/event.rb:48:in `optional_properties'
/Users/abcd/.rvm/gems/ruby-2.0.0-p648/bundler/gems/amplitude-api-40903ce133aa/lib/amplitude_api/event.rb:39:in `to_hash'
/Users/abcd/.rvm/gems/ruby-2.0.0-p648/bundler/gems/amplitude-api-40903ce133aa/lib/amplitude_api.rb:69:in `map'
/Users/abcd/.rvm/gems/ruby-2.0.0-p648/bundler/gems/amplitude-api-40903ce133aa/lib/amplitude_api.rb:69:in `track_body'
/Users/abcd/.rvm/gems/ruby-2.0.0-p648/bundler/gems/amplitude-api-40903ce133aa/lib/amplitude_api.rb:87:in `track'

This is what I did:

	  		event = AmplitudeAPI::Event.new({
		  	      user_id: "1234",
			      event_type: "Eat",
			      event_properties: {
			        id: 5031,
			        name: "Burger",
			      }
			    })
		    AmplitudeAPI.track(event)

RestClient::BadGateway 502

Hello,

we are getting frequently this error when using your library. Could you please give us a hint why this could happen?

Thanks,

Johannes

Deletion of lib/amplitude-api.rb results in NameError: uninitialized constant AmplitudeAPI

Hi @AlvaroMaceda, thanks for version 0.4.0. I noticed that in commit a64b0e8a28559d0f2f6a724f2533fbd3fcad8ba7 you removed the lib/amplitude-api.rb file. That file is used by Rails to autoload the AmplitudeAPI object. Removing the file resulted in this error:

Run bin/rails db:create && bin/rails db:schema:load
rails aborted!
NameError: uninitialized constant AmplitudeAPI

This could easily be fixed by re-adding the deleted file.

If it was your intention to delete the file (i.e. you want us to import the object in a certain way), it might be wise to add a line in the docs for new users on how that should be done. A major version bump / mention in changelog would help people that use the gem as well!

How to set api key in latest master?

While trying to add a few properties to the default whitelist, I've run into an embarrassing problem. I can't figure out how to set the API key anymore. The

AmplitudeAPI.api_key = 'api_key'

described in the README doesn't work anymore, and I can't figure out how AmplitudeAPI::Config is supposed to work.

Some help please. :)

Example of using amplitude-api with Delayed Job

I've setup amplitude-api within my application and it is currently sending events synchronously. I'd like to move these to a background job in order to free up resources.

Can someone give me an example of how they did this?

I currently have a method in my amplitude.rb module that looks like the following:

def track(event)
  AmplitudeAPI.delay.track(event)
end

For some reason the job is added to the delayed_jobs table but the logs just show the job as RUNNING and never COMPLETED.

It'd be helpful to see another example of how people are moving event submission to the background.

The amplitude initialization syntax is now broken on master

I believe this commit broke it: 77c1988
The instructions on the README no longer work:

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

Will throw:

NoMethodError: undefined method `api_key=' for AmplitudeAPI:Class

Before actually releasing 0.10 you should add back in that initialization option or change the doc to reflect the preferred initialization route.

Switching to:

AmplitudeAPI.config.api_key = "abcdef123456"

will properly initialize the gem.

Rubygems release

Thanks for this gem! It's been super helpful, and I'm looking to pull in the changes that were requested in #54 and just need a bit of clarification:

We're currently pulling in the gem from Rubygems, but it looks like it hasn't been released there for a while (latest version is 0.1.1 there, looks like that's also what's listed in the readme badge).

I'm wondering if there will be a new release to Rubygems?

Thanks for your time!

Breaking change in version 0.4.0

Previously in 0.3.3

# config/initializer/amplitude_api.rb
AmplitudeAPI.config.api_key = ENV["AMPLITUDE_TOKEN"]

Now in version 0.4.0, we need to explicitly load the amplitude_api library.

# config/initializer/amplitude_api.rb

require "amplitude_api"
AmplitudeAPI.config.api_key = ENV["AMPLITUDE_TOKEN"]

I'm not sure if this is an intentional change.
Please have a look if you have time.

Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. (LoadError)

OS: Ubuntu 16.04.6 LTS

Could not open library 'libcurl.so': libcurl.so: cannot open shared object file: No such file or directory.
Could not open library 'libcurl.so.4': libcurl.so.4: cannot open shared object file: No such file or directory
	...
/home/ubuntu/.rvm/gems/ruby-2.6.5/gems/ffi-1.9.18/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. (LoadError)

session_id & more not being set

Hey there

It seems that there are quite a few attributes that do not get set on the AmplitudeAPI::Event model when creating via AmplitudeAPI::Event.new

Given this hash:

{
 :event_id=>33785,
 :event_type=>"program_stage_viewed",
 :event_properties=>{"program_id"=>30, "program_title"=>"Program w/ Stages", "program_stage_id"=>1147, "program_stage_title"=>"Week 4"},
 :time=>123123123,
 :user_id=>10,
 :device_id=>"2b7b68cf-aed7-4387-ad07-6e3338c5fe7e",
 :session_id=>457,
 :platform=>"smartphone",
 :os_name=>"iOS",
 :os_version=>"13.2.3",
 :device_brand=>"Apple",
 :device_model=>"iPhone",
 :ip=>"172.19.0.1"
}

The resulting Event object only has the following attributes

#<AmplitudeAPI::Event:0x000055c69aecbcb8 
  @event_type="program_stage_viewed", 
  @event_properties={"program_id"=>30, "program_title"=>"Program w/ Stages", "program_stage_id"=>1147, "program_stage_title"=>"Week 4"}, 
  @time=123123123, 
  @user_id=10, 
  @device_id="2b7b68cf-aed7-4387-ad07-6e3338c5fe7e", 
  @platform="smartphone", 
  @ip="172.19.0.1">

Im just going off the documentation here: https://help.amplitude.com/hc/en-us/articles/360032842391#http-api-v2-events

Any chance this is a bug? Otherwise ill just have to use HTTParty or something

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.