如果您需要通过代理连接到 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();