Kanan Farzali February 2016

How to set date range in Bid Landscapes - Adwords API

I am playing with Bid Landscapes, and as the official documentation describes:

Bid landscapes are a way for you to research information about estimated performance for your ad groups and criteria.

I am testing the API in AdGroup level, and the following piece of code has been written:

public function test_bid_simulator() {
    $user = new AdWordsUser();
    $user->SetClientCustomerId('*******');
    $dataService = $user->GetService('DataService', 'v201509');

    $selector = new Selector();
    $selector->fields = array('AdGroupId', 'StartDate', 'EndDate',
        'Bid', 'LocalClicks', 'LocalCost', 'LocalImpressions');

    // Create predicates.
    $selector->predicates[] = new Predicate('CampaignId', 'IN', array('****', '****', '****', '****'));

    // $selector->dateRange = new DateRange();
    // $selector->dateRange->min = date('Ymd', strtotime('2016/01/28'));
    // $selector->dateRange->max = date('Ymd', strtotime('2016/02/03'));

    do {
        // Make the getAdGroupBidLandscape request.
        $page = $dataService->getAdGroupBidLandscape($selector);

        // Display results.
        if (isset($page->entries)) {
            foreach ($page->entries as $bidLandscape) {
                printf("Found adgroup bid landscape with id '%s' for start "
                        . "date '%s', end date '%s', and landscape points:\n",
                        $bidLandscape->adGroupId,
                        $bidLandscape->startDate,
                        $bidLandscape->endDate);
                foreach ($bidLandscape->landscapePoints as $bidLandscapePoint) {
                    printf("  bid: %.0f => clicks: %d, cost: %.0f, impressions: %d\n", 
                            $bidLandscapePoint->bid->microAmount, 
                            $bidLands        

Answers


Kanan Farzali February 2016

I have posted exactly the same question in Google Groups. This is how the Google AdWords API Team responded:

You cannot set date range for BidLandScape. The system does the calculation based on the latest data, generally last 7 days, depending on data availability. BidLandscape is similiar to the Bid Simulator in UI. You can take a look at this thread which discussed about BidLandScape.

Post Status

Asked in February 2016
Viewed 3,248 times
Voted 9
Answered 1 times

Search




Leave an answer