
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Ruby access to the Mixpanel web analytics tool.
gem install mixpanel_client
or if you use a Gemfile
gem 'mixpanel_client'
require 'rubygems'
require 'mixpanel_client'
client = Mixpanel::Client.new(
api_secret: 'changeme'
timeout: 240, # Default is 60 seconds, increase to reduce timeout errors.
# Optional URI overrides (e.g. https://developer.mixpanel.com/reference/overview)
base_uri: 'api-eu.mixpanel.com',
data_uri: 'example-data.com',
import_uri: 'example-import.com
)
data = client.request(
'events/properties',
event: 'Product Clicked',
name: 'product-clicked',
values: '["value1", "value2"]',
type: 'unique',
unit: 'day',
limit: 5,
from_date: '2013-12-1', #<- Date range
to_date: '2014-3-1' #<-
)
The API also supports passing a time interval rather than an explicit date range.
data = client.request(
'events/properties',
event: 'Product Clicked',
name: 'product-clicked',
values: '["value1", "value2"]',
type: 'unique',
unit: 'day',
limit: 5,
interval: 7 #<- Interval
)
Use the Import API to specify a time in the past. You'll need to include your API token in the data (docs).
To import, encode the data as JSON and use Base64. Encode the data like this:
data_to_import = {
'event' => 'firstLogin',
'properties' => {
'distinct_id' => guid,
'time' => time_as_integer_seconds_since_epoch,
'token' => api_token
}
}
encoded_data = Base64.encode64(data_to_import.to_json)
Then make a request to the API with the given API key, passing in the encoded data:
data = client.request('import', {:data => encoded_data, :api_key => api_key})
You can only import one event at a time.
The option to make parallel requests has been removed (in v5) so that there are no runtime dependencies.
List of rake tasks.
rake -T
Run specs.
rake spec
Run external specs.
cp config/mixpanel.template.yml config/mixpanel.yml
vi config/mixpanel.yml
rake spec:externals
Run rubocop and fix offences.
rubocop
Copyright (c) 2009+ Keolo Keagy. See license for details.
FAQs
Unknown package
We found that mixpanel_client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.