Google-Ads-AdWords-Client
view release on metacpan or search on metacpan
examples/v201809/optimization/estimate_keyword_traffic.pl view on Meta::CPAN
$max_estimate->get_totalCost());
printf "%s:\n", $message;
printf " Estimated average CPC: %.2f\n", $mean_average_cpc;
printf " Estimated ad position: %.2f\n", $mean_average_position;
printf " Estimated daily clicks: %.2f\n", $mean_clicks;
printf " Estimated daily cost: %.2f\n\n", $mean_total_cost;
}
# Calculates the mean microAmount of two Money objects if neither is
# null, else returns NaN.
sub calculate_money_mean {
my ($min_money, $max_money) = @_;
if ($min_money && $max_money) {
return calculate_mean($min_money->get_microAmount(),
$max_money->get_microAmount());
}
return 'NaN';
}
# Calculates the mean of two numbers if neither is null, else returns NaN.
sub calculate_mean {
my ($min, $max) = @_;
if (defined($min) && defined($max)) {
return ($min + $max) / 2;
}
return 'NaN';
}
# Don't run the example if the file is being included.
if (abs_path($0) ne abs_path(__FILE__)) {
return 1;
}
# Log SOAP XML request, response and API errors.
Google::Ads::AdWords::Logging::enable_all_logging();
( run in 0.240 second using v1.01-cache-2.11-cpan-4d50c553e7e )