A bid simulation contains simulation dataand information about the time range, type of simulation data, campaign, ad group, or criterion on which it relates to. The simulation data is a sequence of simulation pointsthat provides a histogram of the predicted performance with different bids during the given timeframe. The information provided by a simulation point depends on the type of simulation data.
Any bid simulation can be retrieved with a GAQL query by selecting the right simulation data field(type of simulation data) from the right resource(bid level).
Bid Level & Resource | SimulationType | Simulation Data Field | Simulation Point Type |
---|---|---|---|
Ad Group
|
|
||
Ad Group Criterion
|
CPC_BID
|
cpc_bid_point_list.points | CpcBidSimulationPoint |
Bidding Strategy (portfolio)
|
|
||
Campaign
|
|
Scaling simulation modification method in campaign simulations
Campaign-level simulations support a special simulation modification method
called SCALING
.
When a CampaignSimulation
has the
modification method SCALING
, it shows what happens if all keyword bids are
scaled by the given scaling modifier. For example, when a scaling modifier is
2.0, it shows what happens if all keyword bids are doubled. For more information
see Estimate your results with bid, budget and target simulators
.
The following example demonstrates how to retrieve and print all CPC bid-typed simulations available for any criteria of a given ad group filtering on its ID.
Java
private void runExample ( GoogleAdsClient googleAdsClient , long customerId , long adGroupId ) { try ( GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient . getLatestVersion (). createGoogleAdsServiceClient ()) { // Creates a query that retrieves the ad group criterion CPC bid simulations. String query = String . format ( "SELECT ad_group_criterion_simulation.ad_group_id, " + "ad_group_criterion_simulation.criterion_id, " + "ad_group_criterion_simulation.start_date, " + "ad_group_criterion_simulation.end_date, " + "ad_group_criterion_simulation.cpc_bid_point_list.points " + "FROM ad_group_criterion_simulation " + "WHERE ad_group_criterion_simulation.type = CPC_BID " + "AND ad_group_criterion_simulation.ad_group_id = %d" , adGroupId ); // Constructs the SearchGoogleAdsStreamRequest. SearchGoogleAdsStreamRequest request = SearchGoogleAdsStreamRequest . newBuilder () . setCustomerId ( Long . toString ( customerId )) . setQuery ( query ) . build (); // Issues the search stream request. ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsServiceClient . searchStreamCallable (). call ( request ); // Iterates over all rows in all messages and prints the requested field values for // the ad group criterion CPC bid simulation in each row. for ( SearchGoogleAdsStreamResponse response : stream ) { for ( GoogleAdsRow googleAdsRow : response . getResultsList ()) { AdGroupCriterionSimulation simulation = googleAdsRow . getAdGroupCriterionSimulation (); System . out . printf ( "Found ad group criterion CPC bid simulation for ad group ID %d, " + "criterion ID %d, start date '%s', end date '%s', and points:%n" , simulation . getAdGroupId (), simulation . getCriterionId (), simulation . getStartDate (), simulation . getEndDate ()); for ( CpcBidSimulationPoint point : simulation . getCpcBidPointList (). getPointsList ()) { System . out . printf ( " bid: %d => clicks: %d, cost: %d, impressions: %d, " + "biddable conversions: %.2f, biddable conversions value: %.2f%s" , point . getCpcBidMicros (), point . getClicks (), point . getCostMicros (), point . getImpressions (), point . getBiddableConversions (), point . getBiddableConversions ()); } } } } }
C#
public void Run ( GoogleAdsClient client , long customerId , long adGroupId ) { // Get the GoogleAdsService. GoogleAdsServiceClient googleAdsService = client . GetService ( Services . V21 . GoogleAdsService ); try { // Creates a query that retrieves the ad group criterion CPC bid simulations. string query = $ @" SELECT ad_group_criterion_simulation.ad_group_id, ad_group_criterion_simulation.criterion_id, ad_group_criterion_simulation.start_date, ad_group_criterion_simulation.end_date, ad_group_criterion_simulation.cpc_bid_point_list.points FROM ad_group_criterion_simulation WHERE ad_group_criterion_simulation.type = CPC_BID AND ad_group_criterion_simulation.ad_group_id = {adGroupId}" ; // Issue a search stream request. googleAdsService . SearchStream ( customerId . ToString (), query , delegate ( SearchGoogleAdsStreamResponse response ) { // Iterates over all rows in all messages and prints the requested field // values for the ad group criterion CPC bid simulation in each row. foreach ( GoogleAdsRow googleAdsRow in response . Results ) { AdGroupCriterionSimulation simulation = googleAdsRow . AdGroupCriterionSimulation ; Console . WriteLine ( "Found ad group criterion CPC bid simulation for " + $"ad group ID {simulation.AdGroupId}, " + $"criterion ID {simulation.CriterionId}, " + $"start date {simulation.StartDate}, " + $"end date {simulation.EndDate}" ); foreach ( CpcBidSimulationPoint point in simulation . CpcBidPointList . Points ) { Console . WriteLine ( $"\tbid: {point.CpcBidMicros} => " + $"clicks: {point.Clicks}, " + $"cost: {point.CostMicros}, " + $"impressions: {point.Impressions}, " + $"biddable conversions: {point.BiddableConversions}, " + "biddable conversions value: " + $"{point.BiddableConversionsValue}" ); } Console . WriteLine (); } } ); }
PHP
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId, int $adGroupId ) { $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); // Creates a query that retrieves the ad group criterion CPC bid simulations. $query = sprintf( 'SELECT ad_group_criterion_simulation.ad_group_id, ' . 'ad_group_criterion_simulation.criterion_id, ' . 'ad_group_criterion_simulation.start_date, ' . 'ad_group_criterion_simulation.end_date, ' . 'ad_group_criterion_simulation.cpc_bid_point_list.points ' . 'FROM ad_group_criterion_simulation ' . 'WHERE ad_group_criterion_simulation.type = CPC_BID ' . 'AND ad_group_criterion_simulation.ad_group_id = %d', $adGroupId ); // Issues a search stream request. /** @var GoogleAdsServerStreamDecorator $stream */ $stream = $googleAdsServiceClient->searchStream( SearchGoogleAdsStreamRequest::build($customerId, $query) ); // Iterates over all rows in all messages and prints the requested field values for // the ad group criterion CPC bid simulation in each row. foreach ($stream->iterateAllElements() as $googleAdsRow) { /** @var GoogleAdsRow $googleAdsRow */ $simulation = $googleAdsRow->getAdGroupCriterionSimulation(); printf( 'Found ad group criterion CPC bid simulation for ad group ID %d, ' . 'criterion ID %d, start date "%s", end date "%s", and points:%s', $simulation->getAdGroupId(), $simulation->getCriterionId(), $simulation->getStartDate(), $simulation->getEndDate(), PHP_EOL ); foreach ($simulation->getCpcBidPointList()->getPoints() as $point) { /** @var CpcBidSimulationPoint $point */ printf( ' bid: %d => clicks: %d, cost: %d, impressions: %d, ' . 'biddable conversions: %.2f, biddable conversions value: %.2f%s', $point->getCpcBidMicros(), $point->getClicks(), $point->getCostMicros(), $point->getImpressions(), $point->getBiddableConversions(), $point->getBiddableConversionsValue(), PHP_EOL ); } print PHP_EOL; } }