اگر نیاز دارید که از طریق یک سرور پروکسی HTTP یا HTTPS به API گوگل ادز متصل شوید، میتوانید تنظیمات پروکسی را در فایل google_ads_php.ini خود یا به صورت برنامهنویسی هنگام ساخت کلاینت پیکربندی کنید.
پیکربندی با google_ads_php.ini
ویژگی proxy را در بخش CONNECTION از فایل google_ads_php.ini خود تنظیم کنید:
[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"
برای مثال، میتوانید http://user:pass@localhost:8082 به عنوان پروکسی مشخص کنید.
پیکربندی از طریق برنامهنویسی
از طرف دیگر، میتوانید تنظیمات پروکسی را به صورت برنامهنویسی شده در GoogleAdsClientBuilder پیکربندی کنید:
$googleAdsClient = (new GoogleAdsClientBuilder())
// ...
->withProxy('http://user:pass@localhost:8082')
->build();