Changing bids for individual keywords , using experment compare the results and if necessary to remove unsuccessful experments

159 views
Skip to first unread message

Sarah Riddell

unread,
Apr 23, 2015, 8:17:42 AM4/23/15
to adwor...@googlegroups.com

Last couple of days, i am using Google Adwords Client Library for PHP. After successful configuration of the library on my localhost, i am able to create Campaigns, AdGroups, Keywords & doing other Report Downloading tasks for my MCC test account using the client library.

I am also able to Add Experiment for my keywords and Modify bidMultipliers that is in the individual AdGroup of a Campaign. Now i have three questions,

  • How can i modify bidMultipliers for individual Keyword not for all keywords within the same AdGroup?

  • How to Remove/Rollback my experiments if experiments not successful ?

  • Is it Possible to Make experimental bid changes to Keywords, AdGroups or Ads individually?

I am using AddExperiment.php of v201502. Suggestion Required.

Josh Radcliff (AdWords API Team)

unread,
Apr 23, 2015, 5:37:25 PM4/23/15
to adwor...@googlegroups.com
Hi,

You can modify bid multipliers for a given keyword by setting the BiddableAdGroupCriterion.experimentData for that Keyword criterion. See the BiddableAdGroupCriterionExperimentData.experimentBidMultiplier attribute, as well as the lines in AddExperiment.php that configure the $adGroupCriterionExperimentData object.

To remove an experiment, issue an ExperimentService.mutate request where you set the Experiment.status to REMOVED.

You can make experimental changes to individual keywords, ad groups or ads as shown in the AddExperiment.php example you mentioned. The example doesn't cover ads, but you would configure an ad's experiment by configuring its AdGroupAd.experimentData, the same as with the other object types.

Cheers,
Josh, AdWords API Team
Message has been deleted

Sarah Riddell

unread,
Apr 27, 2015, 6:36:49 AM4/27/15
to adwor...@googlegroups.com
Hi Josh,

Thanks for reply,

This is the code works for me , let me know am i doing anything wrong?

Working Code:

function AddExperimentExample(AdWordsUser $user, $campaignId, $adGroupId) {
    // Get the services, which loads the required classes.
    $experimentService = $user->GetService('ExperimentService', ADWORDS_VERSION);
    $adGroupService = $user->GetService('AdGroupService', ADWORDS_VERSION);
    $adGroupCriterionService =
        $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);

    // Create experiment.
    $experiment = new Experiment();
    $experiment->campaignId = $campaignId;
    $experiment->name = 'ca_experiment';
    $experiment->queryPercentage = 10;

    // Set additional settings (optional).
    $experiment->startDateTime = date('Ymd His', strtotime('+1 day'));
    $experiment->endDateTime = date('Ymd His', strtotime('+1 month'));

    // Create operation.
    $experimentOperation = new ExperimentOperation();
    $experimentOperation->operand = $experiment;
    $experimentOperation->operator = 'ADD';

    $experimentOperations = array($experimentOperation);

    // Make the mutate request.
    $result = $experimentService->mutate($experimentOperations);

    // Display result.
    $experiment = $result->value[0];
    printf ("Experiment with name '%s' and ID '%.0f' was added.\n",
        $experiment->name, $experiment->id);

    // Create ad group bid multipliers to be used in the experiment.
    $adGroupBidMultipliers = new ManualCPCAdGroupExperimentBidMultipliers();
    $adGroupBidMultipliers->maxCpcMultiplier = new BidMultiplier(2);

    // Create ad group experiment data.
    $adGroupExperimentData = new AdGroupExperimentData();
    $adGroupExperimentData->experimentId = $experiment->id;
    $adGroupExperimentData->experimentDeltaStatus = 'MODIFIED';
    $adGroupExperimentData->experimentBidMultipliers = $adGroupBidMultipliers;



    // Create updated ad group.
    $adGroup = new AdGroup();
    $adGroup->id = $adGroupId;
    $adGroup->experimentData = $adGroupExperimentData;

    // Create operation.
    $adGroupOperation = new AdGroupOperation();
    $adGroupOperation->operand = $adGroup;
    $adGroupOperation->operator = 'SET';

    $adGroupOperations = array($adGroupOperation);

    // Make the mutate request.
    $result = $adGroupService->mutate($adGroupOperations);

    // Display result.
    $adGroup = $result->value[0];
    printf ("Ad group with name '%s' and ID '%.0f' was updated in the "
        . "experiment.\n", $adGroup->name, $adGroup->id);


    // Create ad group bid multipliers to be used in the experiment.
    $adGroupBidMultipliers = new ManualCPCAdGroupCriterionExperimentBidMultiplier();
    $adGroupBidMultipliers->maxCpcMultiplier = new BidMultiplier(4);

    // Create experiment data for a new experiment-only keyword.
    $adGroupCriterionExperimentData =
        new BiddableAdGroupCriterionExperimentData();
    $adGroupCriterionExperimentData->experimentId = $experiment->id;
    $adGroupCriterionExperimentData->experimentDeltaStatus = 'MODIFIED';
    $adGroupCriterionExperimentData->experimentBidMultiplier=$adGroupBidMultipliers;

    // Create keyword.
    $keyword = new Keyword('cloud', 'BROAD');

    // Create ad group criterion.
    $adGroupCriterion = new BiddableAdGroupCriterion();
    $adGroupCriterion->adGroupId = $adGroupId;
    $adGroupCriterion->criterion = $keyword;
    $adGroupCriterion->experimentData = $adGroupCriterionExperimentData;


    // Create operation.
    $adGroupCriterionOperation = new AdGroupCriterionOperation();
    $adGroupCriterionOperation->operand = $adGroupCriterion;
    $adGroupCriterionOperation->operator = 'ADD';

    $adGroupCriterionOperations = array($adGroupCriterionOperation);

    // Make the mutate request.
    $result = $adGroupCriterionService->mutate($adGroupCriterionOperations);

    // Display result.
    $adGroupCriterion = $result->value[0];
    printf("Keyword with text '%s', match type '%s', and ID '%s' was added to "
        . "the experiment.\n",
        $adGroupCriterion->criterion->text,
        $adGroupCriterion->criterion->matchType,
        $adGroupCriterion->criterion->id);
}


Josh Radcliff (AdWords API Team)

unread,
Apr 27, 2015, 11:52:02 AM4/27/15
to adwor...@googlegroups.com
Hi,

I don't see any issues with your code, but I'd recommend looking at the experiment in the Campaign/Settings in the user interface to confirm that the experiment settings are what you expect.

Thanks,
Josh, AdWords API Team

Sarah Riddell

unread,
May 4, 2015, 1:06:49 AM5/4/15
to adwor...@googlegroups.com
Hi Josh,

Many thanks for your previous helps & supports.

Can you help me with this AWQL query?

                SELECT ExternalCustomerId,CampaignId,AdGroupId,Id,AdNetworkType2,AverageCpc,AverageCpm, AveragePageviews,
                     AveragePosition,AverageTimeOnSite,BidType,BiddingStrategyType,BounceRate,ClickAssistedConversionValue ,
                     ClickAssistedConversions,ClickAssistedConversionsOverLastClickConversions,ClickConversionRate ,
                     Clicks ,ConversionRateManyPerClick ,ConversionValue ,ConversionsManyPerClick ,ConvertedClicks ,
                     Cost ,CostPerConversionManyPerClick ,CostPerConvertedClick ,CpcBid ,CriteriaDestinationUrl ,Ctr ,
                     FirstPageCpc ,ImpressionAssistedConversionValue ,ImpressionAssistedConversions ,ImpressionAssistedConversionsOverLastClickConversions ,
                     Impressions ,KeywordMatchType ,PercentNewVisitors,QualityScore ,SearchExactMatchImpressionShare ,
                     SearchImpressionShare,Status ,TopOfPageCpc,ValuePerConversionManyPerClick,ValuePerConvertedClick ,
                     ViewThroughConversions FROM KEYWORDS_PERFORMANCE_REPORT  DURING 20140424,20150424

I want to get above columns from KEYWORDS_PERFORMANCE_REPORT  for specific date. when i run that query it returns all fields value zero. but when i run below query it returns result as i need.

SELECT ExternalCustomerId,CampaignId,AdGroupId,Id FROM KEYWORDS_PERFORMANCE_REPORT DURING 20140424,20150424

How can i get all fields form KEYWORDS_PERFORMANCE_REPORT  for specific date (e.g 2015-05-03, 2015-05-04 etc.)  ?







Josh Radcliff (AdWords API Team)

unread,
May 4, 2015, 10:19:48 AM5/4/15
to adwor...@googlegroups.com
Hi,

Are you sure that the report is returning zero rows? I think it's more likely that it's actually returning an error because there are certain field combinations that are not allowed. Please see this other forum post for more details.

In general, you probably want to avoid selecting every field that's available for a report, not only because of the field combination issue, but also because selecting every field will make your reports run longer because AdWords will have to retrieve a great deal of data for every row. I'd recommend choosing the fields that are actually of interest to you, and limiting your report request to just include those fields.

Thanks,
Josh, AdWords API Team

Sarah Riddell

unread,
May 4, 2015, 11:41:34 AM5/4/15
to adwor...@googlegroups.com
Hi Josh,

Thanks for your reply again. Yes, my report field combination is not right, when i removed AdNetworkType2 field from my SELECT query it returns the results as i desired. As you suggested, i will chose only the fields that are actually of interest to mine.

Can you Clarify? me on-
  • For AdNetworkType2, which report i have to query?
  • Is there any easy way to get data (e.g if i need only cost/click) day by day without downloading reports for every day?
Thank again for you current reply man.

Thanks.

Sunny, Adword API User

Josh Radcliff (AdWords API Team)

unread,
May 4, 2015, 4:02:09 PM5/4/15
to adwor...@googlegroups.com
Hi Sunny,

To find which reports have the AdNetworkType2 field, please refer to the Report Types page.

Regarding your second question, you aren't limited to running a report for a single day. You can either:
  1. Choose one of the date range enums that covers multiple days, such as THIS_MONTH, or
  2. Specify a dateRangeType of CUSTOM_DATE, then set the min and max on the dateRange in your Selector.
In addition, many of the reports allow you to include the Date field, which will break up reporting results by day.

Cheers,
Josh, AdWords API Team

Sarah Riddell

unread,
May 14, 2015, 1:32:54 AM5/14/15
to adwor...@googlegroups.com
Hi Josh,

Sorry to disturb you again because i am stucked again. please help me out of this.

  • Is that any way to get keyword's first appearance date in adwords list?
  • May i need to add 'date' field on this query?

i am downloading report for last 365 days from KEYWORD_PERFORMANCE_REPORT using this query.

                   SELECT ExternalCustomerId,CampaignId, AdGroupId,Id,
                    CampaignName,CampaignStatus,AdNetworkType2,AdGroupName,AdGroupStatus,Status,
                    CpcBid,KeywordText,Impressions FROM KEYWORDS_PERFORMANCE_REPORT
                    WHERE CampaignStatus = ENABLED AND AdGroupStatus = ENABLED AND  IsNegative=FALSE AND  Id != 3000000 AND Status IN [ENABLED, PAUSED] DURING 20140510,20150508

Thanks,

Sany

Josh Radcliff (AdWords API Team)

unread,
May 14, 2015, 3:24:17 PM5/14/15
to adwor...@googlegroups.com, sarahri...@gmail.com
Hi Sany,

You could add the Date field to that report (see the list of available fields for the KEYWORDS_PERFORMANCE_REPORT). In addition, if you want to limit the report output to keywords and dates that actually have impressions, make sure that you exclude zero impressions.

Cheers,
Josh, AdWords API Team

Sarah Riddell

unread,
May 29, 2015, 7:12:02 AM5/29/15
to adwor...@googlegroups.com, sarahri...@gmail.com

Hi Josh,

Sorry to disturb you again because i am stucked again. please help me out of this.When i am trying to set Max. CPC for invidividual keyword i am getting a weird situation .

When i downloaded keyword report two keyword with (same id + same keyword_text) are withing same adgroup  but different adnetworktype2. then the problem is when i am trying to set Max CPC for individual
keywords with different values , i am in a fix how to select my individual keywords . i have attached a png here with field names

Please help me out as you help me previously. Thanks in advance.

Or advice/provide some example code to update keyword Max CPC bid .

KEYWORD FIND
=============
//Update keyword.
            $keyword = new Keyword($value['keyword_text'], $value['keyword_match_type'], $value['id']);  // here no way to specify ad network type 2 like goole search or search partner


TOTAL CODE
==========

// Create ad group bid multipliers to be used in the experiment.
            $adGroupBidMultipliers = new ManualCPCAdGroupCriterionExperimentBidMultiplier();
            $adGroupBidMultipliers->maxCpcMultiplier = new BidMultiplier($value['experiment_bid_multiplier']);



            // Create experiment data for a new experiment-only keyword.
            $adGroupCriterionExperimentData =new BiddableAdGroupCriterionExperimentData();
            $adGroupCriterionExperimentData->experimentId = $experimentId;

            $adGroupCriterionExperimentData->experimentDeltaStatus = 'MODIFIED';
            $adGroupCriterionExperimentData->experimentBidMultiplier=$adGroupBidMultipliers;

            //Update keyword.
            $keyword = new Keyword($value['keyword_text'], $value['keyword_match_type'], $value['id']);


            // Create ad group criterion.
            $adGroupCriterion = new BiddableAdGroupCriterion();
            $adGroupCriterion->adGroupId = $value['adgroup_id'];

            $adGroupCriterion->criterion = $keyword;

            $adGroupCriterion->experimentData = $adGroupCriterionExperimentData;


            // Create operation.
            $adGroupCriterionOperation = new AdGroupCriterionOperation();
            $adGroupCriterionOperation->operand = $adGroupCriterion;
            $adGroupCriterionOperation->operator = 'SET';


            $adGroupCriterionOperations = array($adGroupCriterionOperation);

            // Make the mutate request.
            $result = $adGroupCriterionService->mutate($adGroupCriterionOperations);

Thanks,

Sany

Josh Radcliff (AdWords API Team)

unread,
May 29, 2015, 2:14:14 PM5/29/15
to adwor...@googlegroups.com, sarahri...@gmail.com
Hi Sany,

Could you create a new post for this question? We try to keep each post to one topic -- this makes it much easier for others with similar questions to find the answers they need.

Thanks,
Josh, AdWords API Team

Sany Ahmed

unread,
May 30, 2015, 12:02:39 AM5/30/15
to adwor...@googlegroups.com, sarahri...@gmail.com
Hi Josh,

I have created new post as you told me, please see that  tiitle  "Add Experiment & set Bid Multiplier for Max. CPC"

Thanks in advance.

Sany
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages