Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gam): update api version #676

Merged
merged 1 commit into from
Jul 11, 2023
Merged

fix(gam): update api version #676

merged 1 commit into from
Jul 11, 2023

Conversation

miguelpeixe
Copy link
Member

Updates the GAM API version from v202208 to v202305.

How to test

  1. Install this branch on a fresh install
  2. Connect to GAM using a service account or through Google OAuth
  3. Confirm the account's ad units are synced
  4. Create a new ad unit, and confirm it's created on the ad manager's dashboard
  5. Archive the created ad unit and confirm it's archived on the ad manager's dashboard

@miguelpeixe miguelpeixe self-assigned this Jun 19, 2023
@miguelpeixe miguelpeixe requested a review from a team as a code owner June 19, 2023 13:27
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, when I add my service account credentials, I get a fatal error:

[28-Jun-2023 23:12:19 UTC] PHP Warning:  Network code is not specified. An API function will reject requests if it requires a network code. in /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdManager/AdManagerSessionBuilder.php on line 337
[28-Jun-2023 23:12:19 UTC] PHP Fatal error:  Uncaught Error: Class 'Google\AdsApi\AdManager\v202305\ServiceFactory' not found in /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/api/class-api.php:244
Stack trace:
#0 /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/api/class-api.php(213): Newspack_Ads\Providers\GAM\Api->get_networks(Object(Google\AdsApi\AdManager\AdManagerSession))
#1 /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/api/class-api.php(111): Newspack_Ads\Providers\GAM\Api->get_session()
#2 /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/class-gam-model.php(119): Newspack_Ads\Providers\GAM\Api->init()
#3 /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/class-gam-model.php(1139): Newspack_Ads\Providers\GAM_Model::get_api()
#4 /srv/users/user673052a8/apps/user673052a8/pub in /srv/users/user673052a8/apps/user673052a8/public/wp-content/plugins/newspack-ads/includes/providers/gam/api/class-api.php on line 244

@miguelpeixe
Copy link
Member Author

Perhaps it's missing a composer install?

@dkoo
Copy link
Contributor

dkoo commented Jul 5, 2023

Perhaps it's missing a composer install?

I thought that too, but I see no change after doing a composer install && npm start. The error message also mentions v202305 in the stack trace, which suggests that this version is being called.

@miguelpeixe
Copy link
Member Author

I'm unable to reproduce the issue and the class it's unable to find should be part of v202305: https://github.com/googleads/googleads-php-lib/blob/main/src/Google/AdsApi/AdManager/v202305/ServiceFactory.php

Can you ping me when you're available to take a closer look at your instance?

Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-tested on a JN and it's not happening, so it must be something with my dev environment. All good.

@miguelpeixe miguelpeixe merged commit 6f3687d into master Jul 11, 2023
1 check passed
@miguelpeixe miguelpeixe deleted the fix/update-gam-api branch July 11, 2023 18:13
matticbot pushed a commit that referenced this pull request Jul 20, 2023
## [1.43.1-alpha.1](v1.43.0...v1.43.1-alpha.1) (2023-07-20)

### Bug Fixes

* **gam:** update api version ([#676](#676)) ([6f3687d](6f3687d))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.43.1-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 7, 2023
## [1.43.1](v1.43.0...v1.43.1) (2023-08-07)

### Bug Fixes

* **gam:** update api version ([#676](#676)) ([6f3687d](6f3687d))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.43.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants