CDPGuidesSupport
SDKsIngest

Ruby SDK (ingest)

Quickly integrate the Ours Privacy Ruby SDK using Bundler. Send test requests from the Track Events API reference.

Use this page to install the Ours Privacy Ruby SDK and send events from your server. Every request takes your Ingest API source's API key as token. Copy it from the API Keys card on the source's Settings tab.

Installation

Install the SDK via Bundler by adding the following to your application's Gemfile:

gem "oursprivacy-ingest"

Then run:

bundle install

For more details, visit the RubyGems repository | Github Repo

Usage

Create a client and track an event:

require "bundler/setup"
require "oursprivacy_ingest"

ours_privacy = OursprivacyIngest::Client.new

# Track an event
response = ours_privacy.track.event(token: "your-source-token", event: "Purchase")

puts(response.success)

Next Steps

How is this guide?

On this page