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\v201806\cm\CampaignService does not exist #55

Open
sanjayacloud opened this issue Oct 31, 2019 · 5 comments

Comments

@sanjayacloud
Copy link

Hi Friends,

I am using https://github.com/spotonlive/laravel-google-ads package for Google Ads. And I got the above error. Can anyone help me to resolve this?

My code.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use LaravelGoogleAds\Services\AdWordsService;
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201806\cm\CampaignService;
use Google\AdsApi\AdWords\v201806\cm\OrderBy;
use Google\AdsApi\AdWords\v201806\cm\Paging;
use Google\AdsApi\AdWords\v201806\cm\Selector;

class AdController extends Controller
{
    /** @var AdWordsService */
    protected $adWordsService;

    /**
     * @param AdWordsService $adWordsService
     */
    public function __construct(AdWordsService $adWordsService)
    {
        $this->adWordsService = $adWordsService;
    }


    public function index()
    {
        $customerClientId = '697-169-9937';

        $campaignService = $this->adWordsService->getService(CampaignService::class, $customerClientId);
         dd($campaignService);
        // Create selector.
        $selector = new Selector();
        $selector->setFields(array('Id', 'Name'));
        $selector->setOrdering(array(new OrderBy('Name', 'ASCENDING')));

        // Create paging controls.
        $selector->setPaging(new Paging(0, 100));

        // Make the get request.
        $page = $campaignService->get($selector);
    }
}

@matthewnessworthy
Copy link
Contributor

https://github.com/googleads/googleads-php-lib/releases/tag/41.0.0

Google remove that class, check for an updated version.

@sanjayacloud
Copy link
Author

Is this package has updated version?

@matthewnessworthy
Copy link
Contributor

try v201809 instead of v201806

@sanjayacloud
Copy link
Author

sanjayacloud commented Nov 4, 2019 via email

@matthewnessworthy
Copy link
Contributor

The version is in the https://github.com/spotonlive/laravel-google-ads/blob/master/composer.json#L27 , it's the version I linked above https://github.com/googleads/googleads-php-lib/releases/tag/41.0.0

if you replace use Google\AdsApi\AdWords\v201806 with use Google\AdsApi\AdWords\v201809, then your code should work, if not, then I'm out of ideas for you.

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