如果您需要通过代理连接到 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
指定为代理。或者,您也可以像配置任何其他配置设置一样,以程序化方式配置代理设置:
$googleAdsClient = (new GoogleAdsClientBuilder())
...
->withProxy('protocol://user:pass@host:port')
->build();