Ruby 用戶端程式庫

Ruby 用戶端程式庫託管於 GitHub,而 Gem 則可在 RubyGems 上取得。

這個程式庫支援積極維護的 Ruby 版本 (Ruby 3.2、3.3 和 3.4,gemspec 需求為 Ruby 3.0 以上版本)。

進行第一次 API 呼叫

如要使用 Google Ads API,您需要完成幾個步驟,才能存取 API 並設定 Google Ads 帳戶。快速入門指南會逐步說明所有重要步驟,包括設定 Google Ads 帳戶。

基本用法

如要進一步瞭解如何使用 Ruby 用戶端程式庫,請參閱基本使用指南:

# 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

授權與驗證

Ruby 用戶端程式庫支援多種驗證和授權方法。詳情請參閱授權和驗證指南。

設定和記錄

Ruby 用戶端程式庫支援多種設定和記錄選項。您也可以覆寫每項服務的逾時和重試時間。

公用程式

Ruby 用戶端程式庫包含多個實用類別,可提升 API 的可用性。查看下列指南持續學習: