Upgrade to v24 Google Ads API#98
Merged
Merged
Conversation
Bump googleads/google-ads-php to ^33.4 (ships the V24 API) and google/gax to ^1.36.1, and migrate all V20 namespaces (data, Lib, Util) to V24 across the client, resolvers, uploaders, subscribers and conversion processor. Also drop the orphaned 'loyalty_sign_ups' customer-type-category translation, since UserListCustomerTypeCategory::LOYALTY_SIGN_UPS was removed in v24.
The v24 stubs reference google/gax's generic ServerStream<T> and the top-level Google\Protobuf\RepeatedField class. PHPStan fails on dependency versions that predate these: - google/gax < 1.38 has no @template on ServerStream, so the @var GoogleAdsServerStreamDecorator override is rejected as a non-subtype. - google/protobuf < 4.31.1 ships RepeatedField only via the C extension (no PHP source), causing class.notFound when iterating it. Raise the floors (gax ^1.38, add google/protobuf ^4.31.1 || ^5.34) so those versions can't be installed. google/protobuf is genuinely used (e.g. Google\Protobuf\Internal\Message), so it's declared in require; the analyser attributes those symbols to ext-protobuf and falsely flags it as unused, so ignore that in composer-dependency-analyser.php.
These classes leak version-specific Google\Ads\... (and Google\Protobuf) types through their public/protected signatures, so they break BC on every Google Ads API upgrade by definition. @experimental does not exclude them from the Roave BC check (only @internal does), so mark them @internal and document in the README that neither @experimental nor @internal is covered by the SemVer promise.
@internal already places these classes outside the SemVer/BC promise, so the @experimental tag is redundant on them. Classes belonging to the experimental Customer Lists feature that are not @internal keep their @experimental tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the plugin from Google Ads API v20 to v24.
Changes
composer.json:googleads/google-ads-php^28.0→^33.4(the library release that ships the V24 API stubs; V24 first appears in v33.3.0), andgoogle/gax^1.35.1→^1.36.1(the new library minimum).V20references toV24across the three version-bound families —Google\Ads\GoogleAds\V20\*(data),Google\Ads\GoogleAds\Lib\V20\*(client/builder/stream), andGoogle\Ads\GoogleAds\Util\V20\ResourceNames— in the client, resources, resolvers, uploaders, subscribers and conversion processor. Also bumped the three…/reference/rpc/v20/…doc-URL comments.customer_type_categories.loyalty_sign_upskey, sinceUserListCustomerTypeCategory::LOYALTY_SIGN_UPSwas removed in v24.Breaking-change review (v20 → v24)
Verified against the generated stubs and release notes — no code impact on the surface this plugin uses:
ClickConversion/CartData/ Customer Match (OfflineUserDataJob,UserData,UserIdentifier,CrmBasedUserListInfo,CustomerMatchUserListMetadata) are unchanged.UploadClickConversionsRequest::setDebugEnabled()was removed in v24 — the plugin never used it.ConversionActionType/ConversionActionCategorychanges are purely additive; every constant the plugin references (UPLOAD_CLICKS,PURCHASE, …) keeps its value.Verification
Compatibility note for reviewers / CI
composer.lockis gitignored, so it is not part of this diff. Note that on PHP 8.1 the dependency tree must resolve togoogle/protobuf4.x andbrick/math0.13.x — resolving the tree under a higher PHP can pingoogle/protobuf5.x /brick/math0.14.x, which require PHP>=8.2and would break the declared>=8.1floor. Make sure the lowest-PHP CI job resolves under 8.1.Operational note (not addressed here)
UserListCustomerTypeCategoryvalue9(formerLOYALTY_SIGN_UPS) is gone in v24. The plugin ships no such data and Customer Lists are experimental, but a consuming app that already persistedCustomerList.customerTypeCategory = 9would see that option disappear from the form and get a server-side rejection on re-upload — a one-off data migration would be needed there.