Page Summary
-
Connect to the Google Ads API through a proxy by setting the
proxyproperty in theCONNECTIONsection of yourgoogle_ads_php.inifile. -
The proxy setting in the
google_ads_php.inifile should be in the format "protocol://user:pass@host:port". -
Alternatively, you can configure the proxy setting programmatically using
withProxyin theGoogleAdsClientBuilder.
If you need to connect to the Google Ads API through an HTTP or HTTPS proxy server, you
can configure the proxy setting in your google_ads_php.ini file or
programmatically when building the client.
Configure with google_ads_php.ini
Set the proxy property in the CONNECTION section of your
google_ads_php.ini file:
[CONNECTION]
; Optional proxy settings to be used by requests.
; If you don't have username and password, just specify host and port.
proxy = "http://user:pass@host:port"
For example, you can specify http://user:pass@localhost:8082 as a proxy.
Configure programmatically
Alternatively, you can configure the proxy setting programmatically on
GoogleAdsClientBuilder:
$googleAdsClient = (new GoogleAdsClientBuilder())
// ...
->withProxy('http://user:pass@localhost:8082')
->build();