Documentation for the requested version is not available.Documentation for the requested diff is not available.
ChannelService
Channels provide publishers with a way to track the performance, such
as clickthrough rate, of their pages. By assigning a channel to any
combination of pages, publishers can track a variety of metrics across
their sites. For more information on channels, see the AdSense Help
Center Channels FAQ.
In particular, ChannelService lets you create, list, and modify
channels. To actually view reports, you must go to the AdSense website.
ChannelService provides two types of channels: URL channels and
Custom channels, as specified in ChannelService_Data.type:
URL channels allow publishers to track the performance of their pages
without modifying their ad code by entering a full or partial URL,
They can enter a top-level domain name to track all of the pages on
that domain, or they can enter a partial URL to track all of the
pages below a certain directory. Entering a full URL will track the
performance of that particular page.
Custom channels allow publishers to track performance based on their
specified criteria. By pasting channel-specific ad code into their
pages, publishers can track a variety of metrics across a range of
URLs. Custom channels can be used to track the performance of
different ad formats, for example, or to compare different page
topics to one another.
ChannelService provides most operations in both single and batch
form. For example, createChannel creates a single channel, and
createChannels creates a batch of channels. Using a batch
operation is more efficient than multiple calls to a single operation;
therefore, you are encouraged to use the batch operations wherever possible.
Creating Channels
To create a channel, you must construct a
ChannelService_Data object with parameters channel name, channel
type ("Custom" or "Url"), status ("Active" or "Inactive"), and
synServiceId. Then you can
call either an individual or batch operation, createChannel
or createChannels, to create the channels. These operations
return a ChannelService_Data object with a unique id
for each channel.
Updating Channels
You can activate or inactivate a channel or list of channels. You
do this by setting the status in a ChannelService_Data and
passing that into the updateChannel or updateChannels
operation in ChannelService. Similarly, you can also change
the name of a custom type channel this way.
Other Channel Operations
ChannelService also provides an operation getChannel
to get ChannelService_Data given a channel ID, and its batch
equivalent getChannels for a list of channel IDs.
You can also call getSyndicationService to get
SyndicationService_Data given a channel ID.
In addition, you can delete a channel or list of channels.
if channelId doesn't represent an existing channel
getChannelCode
Retrieve the channel code for channel. Channel codes are used by
publishers to identify AdSense channels, whereas developers use
ChannelService_Data.id to identify a channel within the API.