Google::Adwords::AccountService - Interact with the Google Adwords AccountService API calls
This documentation refers to Google::Adwords::AccountService version 0.2
use Google::Adwords::AccountService; use Google::Adwords::AccountInfo; use Google::Adwords::CoverageType; use Google::Adwords::EmailPromotionsPreferences; use Google::Adwords::CreditCard; use Google::Adwords::Address; my $service = Google::Adwords::AccountService->new(); # login to the Adwords server $service->email($email) ->password($password) ->clientEmail($cemail) ->applicationToken($app_token) ->developerToken($dev_token); # getAccountInfo my $account = $service->getAccountInfo(); print "currencyCode : " . $account->currencyCode . "\n"; print "descriptiveName : " . $account->descriptiveName . "\n"; # getClientAccounts my @emailaccounts = $service->getClientAccounts(); print "getClientAccounts : " . join('|', @emailaccounts) . "\n"; # getCreditCard my $creditcard = $service->getCreditCard(); # setLoginInfo my $ret_setlogininfo= $service->setLoginInfo('email@example.com', 'toto'); # setLocalTimezone to brrr ... my $ret_setlocaltimezone = $service->setLocalTimezone('America/Anchorage'); # setCreditCard my $cc = Google::Adwords::CreditCard->new ->cardNumber(12345678912346) ->cardType('VISA') ->cardVerificationNumber(123) ->expirationMonth(1) ->expirationYear(2008); my $addr = Google::Adwords::Address->new ->addressLine1('down the street') ->city('Paris') ->companyName('Up there') ->countryCode('FR') ->emailAddress('me@example.com') ->name('Up there') ->phoneNumber('+33112345678') ->postalCode('75020'); my $ret_setcreditcard = $service->setCreditCard($cc, $addr); # createAdWordsAccount my $emailPrefs = Google::Adwords::EmailPromotionsPreferences->new ->marketResearchEnabled(1) ->newsletterEnabled(1) ->promotionsEnabled(0); my $covType = Google::Adwords::CoverageType->new ->optInContentNetwork(0) ->optInSearchNetwork(1); my $ret = $service->createAdWordsAccount({ loginEmail => $loginEmail, password => $password, languagePreference => $lgPref, emailPrefs => $emailPrefs, currencyCode => $curCode, cardInfo => $creditcard, contactInfo => $address, defaultAdsCoverage => $covType, timeZoneId => $timeZoneId }); # updateAccountInfo $account->primaryBusinessCategory('Advertising, Marketing, SEO'); my $ret_updateaccountinfo = $service->updateAccountInfo($account);
This module provides an interface to the Google Adword AccountService API calls.
Create a new AdWords account for an online advertiser. If this operation succeeds, the new account is ready for use. Customers need explicit permission from Google to use this method.
my $ret = $obj->createAdWordsAccount({ loginEmail => $loginEmail, password => $password, languagePreference => $lgPref, emailPrefs => $emailPrefs, currencyCode => $curCode, cardInfo => $creditcard, contactInfo => $address, defaultAdsCoverage => $coverageType, timeZoneId => $timeZoneId });
Takes a hashref with following keys:
loginEmail : the login email.
password : the password.
languagePreference : the language preference.
emailPrefs : a Google::Adwords::EmailPromotionsPreferences object.
currencyCode : the currency code.
cardInfo : a Google::Adwords::CreditCard object.
contactInfo : a Google::Adwords::Address object.
defaultAdsCoverage : a Google::Adwords::CoverageType object.
timeZoneId : the id of the timezone.
1 on success
Return the AdWords account specified by the client account header.
my $accountinfo = $obj->getAccountInfo();
None.
A Google::Adwords::AccountInfo object.
Gets the primary email address for each account managed by the effective user. If the effective user user has no client accounts, an empty array is returned.
my @emails = $obj->getClientAccounts();
An array of account login emails.
Return credit card information for the current account.
my $creditcard = $obj->getCreditCard();
A Google::Adwords::CreditCard object.
Set the credit card information for the current account.
my $ret = $obj->setCreditCard($creditcard, $address);
$creditcard : a Google::Adwords::CreditCard object.
$address : a Google::Adwords::Address object.
Set the local timezone for this Account.
my $ret = $obj->setLocalTimezone($timezone);
$timezone : the timezone.
Set the login information for the current user.
my $ret = $obj->setLoginInfo($login, $newPassword);
$login : the login.
$newPassword : the password.
Updates the database to reflect the changes in the account object.
my $ret = $obj->updateAccountInfo($account);
$account : a Google::Adwords::AccountInfo object.
Google::Adwords::AccountInfo
Google::Adwords::CoverageType
Google::Adwords::EmailPromotionsPreferences
Google::Adwords::CreditCard
Google::Adwords::Address
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.