{"id":20936226,"url":"https://github.com/adzerk/adzerk-decision-sdk-ruby","last_synced_at":"2026-04-27T01:31:13.012Z","repository":{"id":40296210,"uuid":"238514496","full_name":"adzerk/adzerk-decision-sdk-ruby","owner":"adzerk","description":"Ruby SDK for Adzerk's Decision API","archived":false,"fork":false,"pushed_at":"2026-03-11T19:22:13.000Z","size":205,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":29,"default_branch":"master","last_synced_at":"2026-03-11T23:36:30.605Z","etag":null,"topics":["management","non-prod"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adzerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-05T17:59:53.000Z","updated_at":"2026-03-11T19:20:09.000Z","dependencies_parsed_at":"2023-02-08T12:31:29.795Z","dependency_job_id":null,"html_url":"https://github.com/adzerk/adzerk-decision-sdk-ruby","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/adzerk/adzerk-decision-sdk-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adzerk","download_url":"https://codeload.github.com/adzerk/adzerk-decision-sdk-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adzerk%2Fadzerk-decision-sdk-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32319559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["management","non-prod"],"created_at":"2024-11-18T22:18:25.331Z","updated_at":"2026-04-27T01:31:12.992Z","avatar_url":"https://github.com/adzerk.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adzerk Ruby Decision SDK\n\nRuby Software Development Kit for Adzerk Decision \u0026 UserDB APIs\n\n## Installation\n\nRequires [Ruby 2.5](https://en.wikipedia.org/wiki/Ruby_(programming_language)#Table_of_versions) or higher.\n\n[RubyGem Package](https://rubygems.org/gems/adzerk_decision_sdk)\n\n```shell\ngem install adzerk_decision_sdk --pre\n```\n\nOr add to your `Gemfile`:\n\n```ruby\ngem 'adzerk_decision_sdk', '~\u003e 1.0.0-pre.beta.2'\n```\n\n## Examples\n\n### API Credentials \u0026 Required IDs\n\n- Network ID: Log into [Adzerk UI](https://app.adzerk.com/) \u0026 use the \"circle-i\" help menu in upper right corner to find Network ID. Required for all SDK operations.\n- Site ID: Go to [Manage Sites page](https://app.adzerk.com/#!/sites/) to find site IDs. Required when fetching an ad decision.\n- Ad Type ID: Go to [Ad Sizes page](https://app.adzerk.com/#!/ad-sizes/) to find Ad Type IDs. Required when fetching an ad decision.\n- API Key: Go to [API Keys page](https://app.adzerk.com/#!/api-keys/) find active API keys. Required when writing to UserDB.\n- User Key: UserDB IDs are [specified or generated for each user](https://dev.adzerk.com/reference/userdb#passing-the-userkey).\n\n### Fetching an Ad Decision\n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\n# Demo network, site, and ad type IDs; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23, site_id: 667480)\n\nrequest = {\n  placements: [{ adTypes: [5] }],\n  user: { key: \"abc\" },\n  keywords: [\"keyword1\", \"keyword2\"],\n}\n\npp client.decisions.get(request)\n```\n\n### Recording Impression \u0026 Clicks\n\nUse with the fetch ad example above.\n\n```ruby\n# Impression pixel; fire when user sees the ad\nclient.pixels.fire(decision.impression_url)\n\n# Click pixel; fire when user clicks on the ad\n# status: HTTP status code\n# location: click target URL\nstatus, location = client.pixels.fire(decision.click_url)\n```\n\n### UserDB: Reading User Record\n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\npp client.user_db.read(\"abc\")\n```\n\n### UserDB: Setting Custom Properties\n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\n\nprops = {\n  favoriteColor: \"blue\",\n  favoriteNumber: 42,\n  favoriteFoods: [\"strawberries\", \"chocolate\"],\n}\n\nclient.user_db.set_custom_properties(\"abc\", props)\n```\n\n### UserDB: Forgetting User Record\n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\n# Demo network ID and API key; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: ENV[\"ADZERK_API_KEY\"])\nclient.user_db.forget(\"abc\")\n```\n\n### Decision Explainer\n\nThe Decision Explainer returns information on a Decision API request explaining why each candidate ad was or was not chosen. \n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\n# Demo network, site, and ad type IDs; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23, site_id: 667480)\n\nrequest = {\n  placements: [{ adTypes: [5] }],\n  user: { key: \"abc\" },\n  keywords: [\"keyword1\", \"keyword2\"],\n}\n\noptions = {\n  include_explanation: true,\n  api_key: ENV[\"ADZERK_API_KEY\"]\n}\n\npp client.decisions.get(request, options)\n```\n\nThe response returns a decision object with placement, buckets, rtb logs, and result information.\n``` json\n{\n  \"div0\": {\n    \"placement\": {},\n    \"buckets\": [],\n    \"rtb_log\": [],\n    \"results\": []\n  }\n}\n```\nThe \"placement\" object represents a decision in which an ad may be served. A Explainer Request can have multiple placements in the request.\nThe \"buckets\" array contains channel and priority information.\nThe \"rtb_logs\" array contains information about Real Time Bidding.\nThe \"results\" array contains the list of candidate ads that did and did not serve, along with a brief explanation.\n\n### Logging\n\nOur logging implementation is meant to be flexible enough to fit into any common Ruby logging framework.\n\nYou can use the [logger](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html) utility to output messages. \n\nThe messages have associated levels: unknown, fatal, error, warn, info, and debug.\n\nThe easiest way to integrate is to write a function that handles translating the data from the Adzerk SDK Logger into whatever logging framework you're using in the rest of your application:\n\n```ruby\nrequire \"adzerk_decision_sdk\"\n\nlogger.level(\"Message\")\n\nclient = AdzerkDecisionSdk::Client.new(logger)\n```\n\n## Documentation\n\n- [Adzerk API Documentation](https://dev.adzerk.com/reference)\n- [Adzerk User \u0026 Developer Documentation](https://dev.adzerk.com/docs)\n\n## Contributing\n\n### Reporting Issues\n\n- For bug fixes and improvements to this SDK please use Github to [open an issue](https://github.com/adzerk/adzerk-decision-sdk-ruby/issues) or send us a [pull request](https://github.com/adzerk/adzerk-decision-sdk-ruby/pulls).\n- For questions or issues regarding Adzerk functionality, please [contact Adzerk support](https://adzerk.com/help/).\n\n### Building\n\nTo install dependencies and run the builds associated with this SDK, please use:\n\n```\nbundler install\nrake spec\ngem build adzerk_decision_sdk.gemspec\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadzerk%2Fadzerk-decision-sdk-ruby/lists"}