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.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f184888d-ae4b-4ae0-a3a9-4076e9693064o%40googlegroups.com.

Reply via email to