public function render() { $adClientId = HOST_AD_CLIENT_ID; $customChannel = new Google_CustomChannel(); $customChannel->setName(sprintf('Sample Channel #%s', $this->getUniqueName())); // Retrieve custom channels list, and display it. $result = $this->adSenseHostService->customchannels->insert($adClientId, $customChannel); $mainFormat = 'Custom channel with ID "%s", code "%s" and name "%s" was created.'; $content = sprintf($mainFormat, $result['id'], $result['code'], $result['name']); print $content; }
public function render() { $adClientId = HOST_AD_CLIENT_ID; $customChannelId = CUSTOM_CHANNEL_ID; $customChannel = new Google_CustomChannel(); $customChannel->setName(sprintf('Updated Sample Channel #%s', $this->getUniqueName())); // Retrieve custom channels list, and display it. $result = $this->adSenseHostService->customchannels->patch($adClientId, $customChannelId, $customChannel); $mainFormat = 'Custom channel with ID "%s" was updated with name "%s".'; $content = sprintf($mainFormat, $result['id'], $result['name']); print $content; }