Migrate from v20 to v21
Update resource names and deprecate old fields to successfully migrate from Google Ads API v20 to v21.
What Changed
Resource Name Format Change
Several resource names have changed their format in v21. For example, Ad Group Ad resource names now require the ad group ID instead of the ad group resource name.
ad_group_ad.ad.id
ad_group_ad.ad.final_urls
Deprecated Fields Removal
Certain fields that were deprecated in earlier versions have been removed in v21. Using these fields will now result in an error.
campaign.bidding_strategy_type
campaign.campaign_budget
Migration Steps
- 1
Review API Release Notes
codeThoroughly read the official Google Ads API v21 release notes. Pay close attention to any announced breaking changes, new features, and deprecations.
- ↳Focus on sections detailing resource naming conventions and field removals.
- 2
Update Resource Name Handling
codeIdentify and update all instances where resource names are constructed or parsed. Adapt your code to the new formats specified in the v21 release notes, particularly for Ad Group Ads and Campaign Budgets.
- ↳Use helper functions for resource name generation to simplify updates.
- ↳Test resource name parsing logic carefully.
- 3
Remove Usage of Deprecated Fields
codeScan your codebase for any fields that have been deprecated and removed in v21. Replace these fields with their recommended alternatives or remove the logic entirely if no direct replacement exists.
- ↳Consult the v21 documentation for suggested replacements.
- ↳Comment out or temporarily remove code using deprecated fields before permanent removal.
- 4
Update SDKs and Libraries
configEnsure you are using the latest client libraries and SDKs that support Google Ads API v21. Outdated libraries may not be compatible with the new API version.
- ↳Check your dependency management tool (e.g., pip, npm, Maven) for available updates.
- ↳Verify compatibility of updated libraries with your existing codebase.
- 5
Implement Comprehensive Testing
testWrite and execute unit tests, integration tests, and end-to-end tests to cover all affected areas. Focus on scenarios involving resource creation, updates, and reporting.
- ↳Use mock data that mimics v21 resource structures.
- ↳Ensure tests cover both successful operations and error handling.
- 6
Staging Environment Deployment and Testing
deployDeploy your updated application to a staging environment that uses the Google Ads API v21. Perform manual testing and monitor logs for any unexpected behavior or errors.
- ↳Utilize a dedicated test account in your staging environment.
- ↳Check API response codes and error messages for clarity.
- 7
Production Deployment
deployOnce confident after staging, deploy the changes to your production environment. Monitor performance and error rates closely immediately after deployment.
- ↳Consider a phased rollout if possible.
- ↳Have a rollback plan ready in case of critical issues.
- 8
Post-Migration Monitoring
verifyContinuously monitor your application's performance and accuracy in production. Compare key metrics before and after the migration to ensure no regressions.
- ↳Track API call success rates and latency.
- ↳Verify reporting accuracy against Google Ads UI data.
Testing Checklist
- 1.
Ad Group Ad Resource Name Generation
Verify that new Ad Group Ads are created with the correct resource name format in v21.
- 2.
Campaign Budget Update
Confirm that campaign budgets can be updated using the correct fields in v21.
- 3.
Reporting Queries
Run various reporting queries and compare results against v20 and Google Ads UI for accuracy.
- 4.
Error Handling for Deprecated Fields
Attempt to use a removed field and confirm that a proper error is returned and handled.
- 5.
Bulk Operations
Test mutations (create, update, delete) for multiple resources in a single API call.
Common Mistakes
✗ Not updating resource name parsing logic.
API calls that reference resources by name will fail with 'RESOURCE_NOT_FOUND' or similar errors.
✓ Carefully review and update all code that constructs or parses resource names according to the v21 format.
✗ Continuing to use deprecated fields.
API requests using removed fields will be rejected with validation errors.
✓ Remove or replace all instances of deprecated fields with their v21-compatible alternatives.
✗ Forgetting to update client libraries.
Incompatibility issues or unexpected behavior due to older library versions not supporting v21 features or changes.
✓ Update your Google Ads API client libraries and SDKs to the latest version compatible with v21.
✗ Insufficient testing, especially for edge cases.
Undiscovered bugs or regressions may appear in production, leading to operational issues.
✓ Implement thorough unit, integration, and end-to-end tests covering all migration-affected areas.
Never get blindsided by an API change again
Deprecatr AI monitors 150+ providers, maps changes to your codebase, and delivers migration checklists before your team hits a breaking change.
Join the Waitlist