Skip to content

Upgrade to v24 Google Ads API#98

Merged
loevgaard merged 4 commits into
2.xfrom
upgrade-google-ads-api-v24
May 29, 2026
Merged

Upgrade to v24 Google Ads API#98
loevgaard merged 4 commits into
2.xfrom
upgrade-google-ads-api-v24

Conversation

@loevgaard

Copy link
Copy Markdown
Member

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), and google/gax ^1.35.1^1.36.1 (the new library minimum).
  • Namespaces: migrated all V20 references to V24 across the three version-bound families — Google\Ads\GoogleAds\V20\* (data), Google\Ads\GoogleAds\Lib\V20\* (client/builder/stream), and Google\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.
  • Translation cleanup: removed the now-orphaned customer_type_categories.loyalty_sign_ups key, since UserListCustomerTypeCategory::LOYALTY_SIGN_UPS was 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:

  • Library client/builder/stream classes, the service-client getters, and the request-object calling convention are unchanged.
  • ClickConversion / CartData / Customer Match (OfflineUserDataJob, UserData, UserIdentifier, CrmBasedUserListInfo, CustomerMatchUserListMetadata) are unchanged.
  • UploadClickConversionsRequest::setDebugEnabled() was removed in v24 — the plugin never used it.
  • ConversionActionType / ConversionActionCategory changes are purely additive; every constant the plugin references (UPLOAD_CLICKS, PURCHASE, …) keeps its value.

Verification

  • PHPStan: no errors
  • PHPUnit: 28 tests / 214 assertions passing (1 skipped = gated live API test)
  • ECS: clean
  • Run on PHP 8.1, 8.2 — green on both.

Compatibility note for reviewers / CI

composer.lock is gitignored, so it is not part of this diff. Note that on PHP 8.1 the dependency tree must resolve to google/protobuf 4.x and brick/math 0.13.x — resolving the tree under a higher PHP can pin google/protobuf 5.x / brick/math 0.14.x, which require PHP >=8.2 and would break the declared >=8.1 floor. Make sure the lowest-PHP CI job resolves under 8.1.

Operational note (not addressed here)

UserListCustomerTypeCategory value 9 (former LOYALTY_SIGN_UPS) is gone in v24. The plugin ships no such data and Customer Lists are experimental, but a consuming app that already persisted CustomerList.customerTypeCategory = 9 would 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.

loevgaard added 4 commits May 29, 2026 09:00
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.
@loevgaard loevgaard merged commit bf16395 into 2.x May 29, 2026
18 of 19 checks passed
@loevgaard loevgaard deleted the upgrade-google-ads-api-v24 branch May 29, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant