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

Class Google\AdsApi\AdWords\v201809\cm\OfflineConversionFeedService does not exist in AdWordsServiceDescriptor.php:44 #668

Closed
jaydig opened this issue Jun 30, 2020 · 7 comments
Assignees

Comments

@jaydig
Copy link

jaydig commented Jun 30, 2020

I have a custom offline conversion upload scritps. didn't make any change to it, it stopped working suddently throwing this erro:

[28-Jun-2020 10:05:02 America/New_York] PHP Fatal error: Uncaught ReflectionException: Class Google\AdsApi\AdWords\v201809\cm\OfflineConversionFeedService does not exist in /home/me/adwds_offline/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsServiceDescriptor.php:44
Stack trace:
#0 /home/me/adwds_offline/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsServiceDescriptor.php(44): ReflectionClass->__construct('Google\AdsApi\A...')
#1 /home/me/adwds_offline/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsServices.php(60): Google\AdsApi\AdWords\AdWordsServiceDescriptor->__construct('Google\AdsApi\A...')
#2 /home/me/adwds_offline/doit_google.php(51): Google\AdsApi\AdWords\AdWordsServices->get(Object(Google\AdsApi\AdWords\AdWordsSession), 'Google\AdsApi\A...')
#3 {main}
thrown in /home/me/adwds_offline/vendor/googleads/googleads-php-lib/src/Google/AdsApi/AdWords/AdWordsServiceDescriptor.php on line 44

Any advice to solve this?

@fiboknacky
Copy link
Member

Does this happen every time or intermittently?
Have you made any changes to your project folders or updated your dependencies recently?

@jaydig
Copy link
Author

jaydig commented Jul 1, 2020

happens every time. I can't recall any change. I simply didn't ran this project for few months and now it's like that.
I tried updating composer and recreate vendor file, still get same error.

@fiboknacky
Copy link
Member

Could you share your project's composer.json along with your code?
(Be sure to hide any sensitive information)

Thanks.

@fiboknacky fiboknacky self-assigned this Jul 1, 2020
@jaydig
Copy link
Author

jaydig commented Jul 1, 2020

This is my composer.json:

{
    "require": {
        "googleads/googleads-php-lib": "^36.0"
    }
}

@jaydig
Copy link
Author

jaydig commented Jul 1, 2020

and this is relevant part of script:

 	require('config.php');

	require('PicoDatabase.php');
	$DB = new PicoDatabase(DB_HOST, DB_USER, DB_PASS, DB_NAME);

	#non relvant code# 
	
	if(!$rows)  die();

	require(__DIR__ . '/vendor/autoload.php');

	use Google\AdsApi\Common\OAuth2TokenBuilder;
	use Google\AdsApi\Common\AdsLoggerFactory;
	use Google\AdsApi\AdWords\AdWordsSessionBuilder;
	use Google\AdsApi\AdWords\AdWordsServices;
	use Google\AdsApi\AdWords\v201809\cm\OfflineConversionFeedService;
	use Google\AdsApi\AdWords\v201809\cm\OfflineConversionFeed;
	use Google\AdsApi\AdWords\v201809\cm\OfflineConversionFeedOperation;
	use Google\AdsApi\AdWords\v201809\cm\Operator;

	$oAuth2Credentials = (new OAuth2TokenBuilder())
			->withClientId(GOOGLE_APP_CLIENT_ID)
			->withClientSecret(GOOGLE_APP_CLIENT_SECRET)
			->withRefreshToken(GOOGLE_ACC_REFRESH_TOKEN)
			->build()
	;

	//dbg
	$soap_debug_file = dirname(__FILE__).'/google_soap_debug.log';
	$SoapLogger = (new AdsLoggerFactory())->createLogger('AW_SOAP', $soap_debug_file, 'DEBUG');

	$AdWordsSession = (new AdWordsSessionBuilder())
			->withOAuth2Credential($oAuth2Credentials)
			->withDeveloperToken(GOOGLE_ADWORDS_DEVELOPER_TOKEN)
			->withClientCustomerId(preg_replace('#[^0-9]+#', '', GOOGLE_ADWORDS_CUSTOMER_ID))
			//dbg
			->withSoapLogger($SoapLogger)
			->build()
	;

	$adWordsServices = new AdWordsServices();

	$offlineConversionService = $adWordsServices->get($AdWordsSession, OfflineConversionFeedService::class);

	function uploadConversion(&$offlineConversionService, $time, $value, $gclid) {
		#non relvant code# 

		return true;
	}

 
	foreach($rows as &$row) {
		echo 'processing row id=', $row['id'], "\n";

	#non relvant code# 
	}

@fiboknacky
Copy link
Member

fiboknacky commented Jul 1, 2020

Could you update to the latest version (47.0.0) and try again first?
The AdWords API v201809 is not available until 37.1.0, while you're using 36.0.
That's probably the cause of your error.

@jaydig
Copy link
Author

jaydig commented Jul 1, 2020

Thanks, it worked!

@jaydig jaydig closed this as completed Jul 1, 2020
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

No branches or pull requests

2 participants