Para analizar nuestros productos y brindar comentarios sobre ellos, únete al canal oficial de Discord de Google Ads en el servidor de la Comunidad de Publicidad y Medición de Google.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Existen dos tipos de transporte que se pueden usar cuando se envían solicitudes a la API. Nuestra biblioteca cliente selecciona la opción óptima entre las siguientes:
Alternativa que se usa cuando gRPC no está disponible: REST. No requiere la instalación de ninguna extensión de PHP y se basa en HTTP/1.1.
Si prefieres especificar el tipo de transporte por tu cuenta en lugar de depender de las reglas predeterminadas que se describieron anteriormente, puedes establecer la propiedad transport en la sección CONNECTION de tu archivo google_ads_php.ini:
[CONNECTION]; Optional transport settings.; By default, "grpc" is used if available otherwise "rest".transport = "grpc"
Como alternativa, puedes configurar el parámetro de transporte de forma programática como cualquier otro:
$googleAdsClient = (new GoogleAdsClientBuilder()) ... ->withTransport('grpc') ->build();
[null,null,["Última actualización: 2025-08-27 (UTC)"],[[["\u003cp\u003eThe Google Ads API client library supports two transport types: gRPC (preferred) and REST (fallback).\u003c/p\u003e\n"],["\u003cp\u003egRPC offers better performance but requires the gRPC PHP extension, while REST is based on HTTP/1.1 and doesn't require any specific extension.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually specify your preferred transport type through the \u003ccode\u003egoogle_ads_php.ini\u003c/code\u003e configuration file or programmatically within your code.\u003c/p\u003e\n"],["\u003cp\u003eThe gRPC version utilized by the library is usually managed through dependencies, primarily \u003ccode\u003egoogle/gax\u003c/code\u003e, and occasionally directly within the library's own \u003ccode\u003ecomposer.json\u003c/code\u003e for optimization or compatibility.\u003c/p\u003e\n"]]],[],null,["# Transport\n\nThere are two types of transport that can be used when sending requests to the\nAPI. Our client library selects the optimal one from the following:\n\n- **Preferred** : [gRPC](https://grpc.io/about/). It requires the [installation\n of the gRPC PHP extension](//grpc.io/docs/quickstart/php/) and it is based on HTTP/2.\n- Alternative used when gRPC is not available: [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). It does not require the installation of any PHP extension and it is based on HTTP/1.1.\n\nIf you prefer to specify the transport type yourself instead of relying on\nthe default rules described above, you can set the `transport` property in the\n`CONNECTION` section of your\n[`google_ads_php.ini`](https://github.com/googleads/google-ads-php/blob/HEAD/examples/Authentication/google_ads_php.ini)\nfile: \n\n [CONNECTION]\n ; Optional transport settings.\n ; By default, \"grpc\" is used if available otherwise \"rest\".\n transport = \"grpc\"\n\nAlternatively, you can configure the transport setting programmatically like\nevery other ones: \n\n $googleAdsClient = (new GoogleAdsClientBuilder())\n ...\n -\u003ewithTransport('grpc')\n -\u003ebuild();\n\n| **Key Point:** Typically, the grpc version that this PHP library relies on is transitively specified in [`composer.json`](https://github.com/googleapis/gax-php/blob/master/composer.json) of `google/gax`, which is one of the core dependencies. In some cases, we may specify the protobuf version directly in [`composer.json`](https://github.com/googleads/google-ads-php/blob/HEAD/composer.json) of the PHP library, for better performance or for compatibility."]]