如果您需要透過 Proxy 連線至 Google Ads API,請在 google_ads_php.ini
檔案的 CONNECTION
區段中設定 proxy
屬性:
[CONNECTION]
; Optional proxy settings to be used by requests.
; If you don't have username and password, just specify host and port.
proxy = "protocol://user:pass@host:port"
舉例來說,您可以將 http://user:pass@localhost:8082
指定為 Proxy。此外,您也可以像任何其他配置設定一樣,以程式輔助方式配置 Proxy 設定:
$googleAdsClient = (new GoogleAdsClientBuilder())
...
->withProxy('protocol://user:pass@host:port')
->build();