class JGoogleDataAdsense extends JGoogleData

Google Adsense data class for the Joomla Platform.

Methods

__construct( Registry $options = null, JGoogleAuth $auth = null)

Constructor.

boolean
authenticate()

Method to authenticate to Google

boolean
isAuthenticated()

Check authentication

mixed
getOption( string $key)

Get an option from the JGoogleData instance.

setOption( string $key, mixed $value)

Set an option for the JGoogleData instance.

mixed
getAccount( string $accountID, boolean $subaccounts = true)

Method to get an Adsense account's settings from Google

mixed
listAccounts( array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense accounts from Google

mixed
listClients( string $accountID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense clients from Google

mixed
getUnit( string $accountID, string $adclientID, string $adunitID)

Method to get an AdSense AdUnit

mixed
listUnitChannels( string $accountID, string $adclientID, string $adunitID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Custom Channels for a specific Adunit

mixed
getChannel( string $accountID, string $adclientID, string $channelID)

Method to get an Adsense Channel

mixed
listChannels( string $accountID, string $adclientID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Custom Channels

mixed
listChannelUnits( string $accountID, string $adclientID, string $channelID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Adunits for a specific Custom Channel

mixed
listUrlChannels( string $accountID, string $adclientID, array $options = array(), int $maxpages = 1)

Method to generate a report from Google AdSense

mixed
generateReport( string $accountID, mixed $start, mixed $end = false, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Channel URLs

Details

__construct( Registry $options = null, JGoogleAuth $auth = null)

Constructor.

Parameters

Registry $options Google options object.
JGoogleAuth $auth Google data http client object.

boolean authenticate()

Method to authenticate to Google

Return Value

boolean True on success.

boolean isAuthenticated()

Check authentication

Return Value

boolean True if authenticated.

mixed getOption( string $key)

Get an option from the JGoogleData instance.

Parameters

string $key The name of the option to get.

Return Value

mixed The option value.

JGoogleData setOption( string $key, mixed $value)

Set an option for the JGoogleData instance.

Parameters

string $key The name of the option to set.
mixed $value The option value to set.

Return Value

JGoogleData This object for method chaining.

mixed getAccount( string $accountID, boolean $subaccounts = true)

Method to get an Adsense account's settings from Google

Parameters

string $accountID ID of account to get
boolean $subaccounts Include list of subaccounts

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listAccounts( array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense accounts from Google

Parameters

array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listClients( string $accountID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense clients from Google

Parameters

string $accountID ID of account to list the clients from
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed getUnit( string $accountID, string $adclientID, string $adunitID)

Method to get an AdSense AdUnit

Parameters

string $accountID ID of account to get
string $adclientID ID of client to get
string $adunitID ID of adunit to get

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listUnitChannels( string $accountID, string $adclientID, string $adunitID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Custom Channels for a specific Adunit

Parameters

string $accountID ID of account
string $adclientID ID of client
string $adunitID ID of adunit to list channels from
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed getChannel( string $accountID, string $adclientID, string $channelID)

Method to get an Adsense Channel

Parameters

string $accountID ID of account to get
string $adclientID ID of client to get
string $channelID ID of channel to get

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listChannels( string $accountID, string $adclientID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Custom Channels

Parameters

string $accountID ID of account
string $adclientID ID of client to list channels from
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listChannelUnits( string $accountID, string $adclientID, string $channelID, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Adunits for a specific Custom Channel

Parameters

string $accountID ID of account
string $adclientID ID of client
string $channelID ID of channel to list units from
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed listUrlChannels( string $accountID, string $adclientID, array $options = array(), int $maxpages = 1)

Method to generate a report from Google AdSense

Parameters

string $accountID ID of account
string $adclientID ID of client
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

UnexpectedValueException

mixed generateReport( string $accountID, mixed $start, mixed $end = false, array $options = array(), int $maxpages = 1)

Method to retrieve a list of AdSense Channel URLs

Parameters

string $accountID ID of account
mixed $start Start day
mixed $end End day
array $options Search settings
int $maxpages Maximum number of pages of accounts to return

Return Value

mixed Data from Google

Exceptions

InvalidArgumentException
UnexpectedValueException