Forum Moderators: martinibuster

Message Too Old, No Replies

Code Help for Adsense For Search Custom Channels

         

heyday

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

10+ Year Member



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.

[developers.google.com...]

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.

levo

7:48 pm on Jul 6, 2018 (gmt 0)

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



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.

heyday

7:56 pm on Jul 6, 2018 (gmt 0)

10+ Year Member



Awesome thanks Levo!