Wenn Sie über einen Proxy eine Verbindung zur Google Ads API herstellen müssen, können Sie die http_proxy-Konfiguration in der Datei google-ads.yaml festlegen:
# Proxy configuration
###############################################################################
# Below you can specify an optional proxy configuration to be used by #
# requests. If you don't have username and password, just specify host and #
# port. #
# #############################################################################
http_proxy: INSERT_PROXY_HERE
Sie können beispielsweise http://user:pass@localhost:8082 als Proxy angeben.
Alternativ können Sie die Proxyeinstellung wie jede andere Konfigurationseinstellung programmatisch mit den GoogleAdsClient-Methoden load_from_dict, load_from_env und load_from_string konfigurieren. Beispiel:
config = {
...
"http_proxy": "INSERT_PROXY_HERE",
}
googleads_client = GoogleAdsClient.load_from_dict(config)
Wenn Sie einen Proxy mit der load_from_env-Methode verwenden möchten, legen Sie die Umgebungsvariable GOOGLE_ADS_HTTP_PROXY fest.