Welcome to WebmasterWorld Guest from

Forum Moderators: martinibuster

Message Too Old, No Replies

Code Help for Adsense For Search Custom Channels

3:49 pm on Jul 6, 2018 (gmt 0)

Full Member

10+ Year Member

joined:July 9, 2005
posts: 204
votes: 2

So I see inside my Adsense Account under search I can create custom channels and I see when I create a search engine I can assign one or more of those channels for that search engine. The code it generates doesn't show anything about channels so I guess it's done internally as I can filter reports and see these assigned channels.

A few questions.

1 How do I add the gcse code to specify an ad channel for a particular search engine?

From my reading I think I can add something like this to the bottom of the code to get it to do that.

<gcse:searchresults-only adchannel="0000000000"></gcse:searchresults-only>

2. How would I add more than one add channel to that code? What would the syntax be.

3. Can I even do this? I read this info over at the Google Custom Search link here.


But does this code syntax also apply to CSE / Adsense for search?

4. Does this count as modifying the ad code which is against the TOS?

When I add this code I do not see the results in the view source so I was thinking it strips it out?

Thanks for any feedback.
7:48 pm on July 6, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Dec 12, 2004
votes: 15

According to that help page 'adchannel=' is correct. The syntax for using multiple channels for 'content ad units' is "0001+0002+0003", it should work for search too.

One of the allowed code modifications is 'Setting custom channels dynamically' (https://support.google.com/adsense/answer/1354736?hl=en), but it's always best to contact Adsense and ask for permission.
7:56 pm on July 6, 2018 (gmt 0)

Full Member

10+ Year Member

joined:July 9, 2005
posts: 204
votes: 2

Awesome thanks Levo!