Ruby client library

  • The Ruby client library is available on GitHub and RubyGems.

  • The library supports the three most recent Ruby major versions.

  • Familiarity with the API basics is required to use this library.

  • Getting started instructions can be found in the library's README.

The Ruby client library is hosted on GitHub and the gem is available on RubyGems.

The library supports actively maintained Ruby releases (Ruby 3.2, 3.3, and 3.4, with a gemspec requirement of Ruby 3.0 or later).

Make your first API call

To use the Google Ads API, you need to perform several steps to get access to the API and configure your Google Ads accounts. The quick start guide walks you through all the important steps, including setting up your Google Ads accounts.

Basic usage

Refer to the basic usage guide to learn more about how to use the Ruby client library:

# Optional when using Bundler.require in v41.1.0 and later:
require 'google/ads/google_ads'

# Initialize the client using your ~/google_ads_config.rb configuration file.
client = Google::Ads::GoogleAds::GoogleAdsClient.new

# Access a specific service.
customer_service = client.service.customer

Authorization and authentication

The Ruby client library supports multiple approaches to authentication and authorization. Refer to the authorization and authentication guide to learn more.

Configuration and logging

The Ruby client library supports multiple configuration and logging options. Each service's timeout and retry periods can be overridden as well.

Utilities

The Ruby client library includes several utility classes to improve API usability. Refer to the following guides to learn more: