Google::Adwords::TrafficEstimatorService - Interact with the Google Adwords TrafficEstimatorService API calls
This documentation refers to Google::Adwords::TrafficEstimatorService version 0.1.2
use Google::Adwords::TrafficEstimatorService; use Google::Adwords::AdGroupRequest; use Google::Adwords::KeywordRequest; use Google::Adwords::CampaignRequest; # Create the service object my $service = Google::Adwords::TrafficEstimatorService->new(); # Login to the Adwords server $service->email($email) ->password($password) ->applicationToken($app_token) ->developerToken($dev_token); # if you use a MCC #$service->clientEmail('clientemail@domain.com'); # or #$service->clientCustomerId($customerid); # create some KeywordRequest objects my $kwreq1 = Google::Adwords::KeywordRequest->new ->text('web analytics') ->type('Broad') ->maxCpc(1000000); my $kwreq2 = Google::Adwords::KeywordRequest->new ->text('anti spam product') ->type('Broad') ->maxCpc(1000000); # estimateKeywordList my @keyword_estimates = $service->estimateKeywordList($kwreq1, $kwreq2); for ( @keyword_estimates ) { print "Id : " . $_->id . " | upperAvgPosition : " . $_->upperAvgPosition . "\n"; } # Create AdGroupRequest objects my $adgrpreq1 = Google::Adwords::AdGroupRequest->new ->maxCpc(50000000) ->keywordRequests($kwreq1, $kwreq2); # estimateAdGroupList my @adgroupestimates = $service->estimateAdGroupList($adgrpreq1); for ( @adgroupestimate ) { print "Id : " . $_->id . "\n"; foreach my $kw ( @{$_->keywordEstimates} ) { print "\tId: " . $kw->id . " | upperAvgPosition : " . $kw->upperAvgPosition . "\n"; } } # Create a CampaignRequest object my $cmpgreq1 = Google::Adwords::CampaignRequest->new; # geoTargeting $cmpgreq1->geoTargeting({ cities => [ 'Pelican, AK US' ] }); # languageTargeting $cmpgreq1->languageTargeting({ languages => [ 'fr', 'en' ] }); $cmpgreq1->adGroupRequests($adgrpreq1); # estimateCampaignList my @campaign_estimates = $service->estimateCampaignList($cmpgreq1); for ( @campaign_estimates ) { print "Id : " . $_->id . "\n"; foreach my $adgrp ( @{$_->adGroupEstimates} ) { print "\tAdGroup Id: " . $adgrp->id . "\n"; foreach my $kw ( @{$adgrp->keywordEstimates} ) { print "\t\tKeyword Id: " . $kw->id . " | upperAvgPosition : " . $kw->upperAvgPosition . "\n"; } } }
This module provides an interface to the Google Adwords TrafficEstimatorService API calls.
Returns traffic estimates for the requested set of new or existing ad groups. All of the ad groups must be new or all of the ad groups must be from the same campaign. New ad groups are estimated as if they were part of a new campaign with global targeting.
my @adgroup_estimates = $obj->estimateAdGroupList($adgrpreq1, $adgrpreq2);
A list of Google::Adwords::AdGroupRequest objects.
A list of Google::Adwords::AdGroupEstimate objects.
Returns traffic estimates for the requested set of campaigns. The campaigns can be all new or all existing, or a mixture of new and existing.
my @campaign_estimates = $obj->estimateCampaignList($cmpgnreq1, $cmpgnreq2);
A list of Google::Adwords::CampaignRequest objects.
A list of Google::Adwords::CampaignEstimate objects.
Returns traffic estimates for the requested set of new keywords. All of the keywords must be new. Keywords are estimated as if they were part of a single new ad group in a single new campaign with global targeting.
my @keyword_estimates = $obj->estimateKeywordList($kwreq1, $kwreq2);
A list of Google::Adwords::KeywordRequest objects.
A list of Google::Adwords::KeywordEstimate objects.
Google::Adwords::KeywordRequest
Google::Adwords::KeywordEstimate
Google::Adwords::AdGroupRequest
Google::Adwords::AdGroupEstimate
Google::Adwords::CampaignRequest
Google::Adwords::CampaignEstimate
Rohan Almeida <rohan@almeida.in>
Mathieu Jondet <mathieu@eulerian.com>
Copyright (c) 2006 Rohan Almeida <rohan@almeida.in>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Google::Adwords, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Adwords
CPAN shell
perl -MCPAN -e shell install Google::Adwords
For more information on module installation, please visit the detailed CPAN module installation guide.