Forum Moderators: martinibuster

Message Too Old, No Replies

How to attach AdSense Channels to asynchronous Google Publisher Tags?

         

DaStarBuG

2:17 pm on Oct 29, 2011 (gmt 0)

10+ Year Member



Hello

With the old DFP Small Business Ad Manager Tags there was the possibility to attach AdSense Channels to DFP Ad Units with:

<script type=’text/javascript’>
GA_googleAddSlot(“ca-pub-YOUR_PUB-ID”, “Ad-Unit-Name”);
GA_googleAddAdSenseSlotAttr(“Ad-Unit-Name“, “google_ad_channel“, “Channel-ID“);
</script>

I can't find any documentation on how to manage this with the new asynchronous Google Publisher Tags.

Can anyone help me with this?

StarBuG

Leonard0

3:59 pm on Oct 29, 2011 (gmt 0)

10+ Year Member



googletag.pubads().set("adsense_channel_ids", "Channel-ID");
[google.com...]

DaStarBuG

4:12 pm on Oct 29, 2011 (gmt 0)

10+ Year Member



Thanks but this attaches one or more channels to all Ad Units loaded on a single page.

With the old method it was possible to attach one or more channels to a specific ad unit.

What I need is to attach different Channels to different ad units on a single page

Example:

DFP Ad Unit1 -> AdSense Channel 1
DFP Ad Unit2 -> AdSense Channel 2
DFP Ad Unit3 -> AdSense Channel 3

Leonard0

4:51 pm on Oct 29, 2011 (gmt 0)

10+ Year Member



Look under
    Method details for adSlot
on the same page:


set

adSlot.set(key, value)
Sets values for AdSense parameters on a particular ad slot. This will override any values set at the service level for this key. See the set table above for a list of available keys and values. Calling this function more than once for the same key will override previously set values for that key. All values must be set before any display call.

Parameters:

string key - Key name of the parameter for which to set a value.
string value - Value of the key.
Example:

// setting targeting on a single ad slot
var slot = googletag.defineSlot("/1234567/skyscraper", [160, 600]).addService(googletag.pubads());
slot.set("adsense_background_color", "#FFFFFF");

DaStarBuG

8:10 pm on Oct 29, 2011 (gmt 0)

10+ Year Member



PERFECT!

Thank you so much.