Existing campaign with adgroup traffic estimation

18 views
Skip to first unread message

denma test

unread,
Aug 25, 2020, 5:05:13 AM8/25/20
to AdWords API and Google Ads API Forum
Hi
I have created a campaign with one adgroup, how can i get adgroup estimation with and without keywords. Have done code as like below

public function trafficExists(){
        $session = self::setSession();
        $adWordsServices = new AdWordsServices();
        $trafficEstimatorService = $adWordsServices->get($session, TrafficEstimatorService::class);

        // adGroupEstimateRequests
        $adGroupEstimateRequest = new AdGroupEstimateRequest();
        $adGroupEstimateRequest->setAdGroupId(111118503567);

        // Create keywords. Up to 2000 keywords can be passed in a single request.
        $keywords = [];

        $keyword = new Keyword();
        $keyword->setText('loans');
        $keyword->setMatchType(KeywordMatchType::BROAD);
        $keywords[] = $keyword;

        $keyword = new Keyword();
        $keyword->setText('insurance');
        $keyword->setMatchType(KeywordMatchType::BROAD);
        $keywords[] = $keyword;

        $keyword = new Keyword();
        $keyword->setText('banking');
        $keyword->setMatchType(KeywordMatchType::BROAD);
        $keywords[] = $keyword;

        // Create a keyword estimate request for each keyword.
        $keywordEstimateRequests = [];
        foreach ($keywords as $keyword) {
            $keywordEstimateRequest = new KeywordEstimateRequest();
            $keywordEstimateRequest->setKeyword($keyword);
            $keywordEstimateRequests[] = $keywordEstimateRequest;
        }

        // Create ad group estimate requests.
        $adGroupEstimateRequest = new AdGroupEstimateRequest();
        $adGroupEstimateRequest->setKeywordEstimateRequests(
            $keywordEstimateRequests
        );

        $money = new Money();
        $money->setMicroAmount(1000000);
        $adGroupEstimateRequest->setMaxCpc($money);
       
        // Create campaign estimate requests.
        $campaignEstimateRequest = new CampaignEstimateRequest();
        $campaignEstimateRequest->setAdGroupEstimateRequests(
            [$adGroupEstimateRequest]
        );

        $campaignEstimateRequest->setCampaignId(10942093123);

        $selector = new TrafficEstimatorSelector();
        $selector->setCampaignEstimateRequests([$campaignEstimateRequest]);

        // Optional: Request a list of campaign level estimates segmented by
        // platform.
        $selector->setPlatformEstimateRequested(true);

        $result = $trafficEstimatorService->get($selector);

        print_r($result);
        exit();
    }
However the result is not matched with Adgroup estimate result. The thing is adgroup estimates working in google ads UI even there is no keywords setup, it changed when changing demographic targets too. Please let me know the solution for below
1. Created Adgroup estimates without keywords
2. Created Adgroup estimates with Verticals, Demographic, Placements
Once i done this will worl while create new campaign, it would be easier if i done the above. Please share me exact example code in PHP.

Google Ads API Forum Advisor Prod

unread,
Aug 25, 2020, 2:18:53 PM8/25/20
to denm...@gmail.com, adwor...@googlegroups.com
Hi,

I see you've posted similar questions on multiple posts. Please try to limit the posts you make since it'll help with our support.

Unfortunately, there are no ad group estimates in the API. You will need to include keywords. There is, however, a feature request to have them added. Follow our blog for announcements.

Regards,
Anthony
Google Ads API Team

Google Logo
Anthony
Google Ads API Team
 


ref:_00D1U1174p._5004Q23uSZM:ref

denma test

unread,
Aug 26, 2020, 1:46:57 AM8/26/20
to AdWords API and Google Ads API Forum
Hi
Thanks for the confirmation, sure will limit the similar posts as you mentioned. However can you please check with my another question subject as  "impressionsPerDay calcualtion" please, so i can finalize the Traffic estimator setup from my end.
Reply all
Reply to author
Forward
0 new messages