Highlighted

Defining Out of Page Slots in GPT

Hi, we need to be able to define out of page slots using the 'Multiple slots config variable' in DFP. Currently this is done using DFP natively with the command: googletag.defineOutOfPageSlot("[Network Code + Targeted Ad Unit]", "[div-id]").addService(googletag.pubads()); but I can't find an equivalent within Tealium.
6 REPLIES 6
Highlighted

Defining Out of Page Slots in GPT

Tealium Employee
The very latest GPT tag template adds support for "defineOutOfPageSLot" To use this call (instead of the standard defineSlot) leave the 'height' and 'width' fields blank in the GPT tag config.
Highlighted

Defining Out of Page Slots in GPT

Tealium Employee
If you have multiple slots per page, you can also us this notation: // Javascript Extension scoped to your GPT tag u.gptSlots = []; u.gptSlots.push(['networkcode/adunit', [[728, 90]], 'banner']); u.gptSlots.push(['networkcode/adunit2', [[300, 250],[600,250]], 'mpu']); // with 'null' as second param this is an "Out Of Page" slot u.gptSlots.push(['networkcode/adunit3', null, 'mpu']); // adding custom attributes and using a dynamic slot id u.gptSlots.push([b.gpt_slot_id, [[100, 728]], 'skyscraper', {"place":"london","theme":"sports"}]);
Highlighted

Defining Out of Page Slots in GPT

Hi Ty, As soon as I try to use a slot with a null dimensions value all my other slots don't load (yet there's no error message or crash). Here's the code on the utag_data for a page with a null dimensions value: var utag_data = { "gpt_slots": [ ["5129\/AIBM.Business.Spectator\/homepage", [ [950, 50] ], "ad-950x50", { "node_categories": ",", "adposition": "950x50" }], ["5129\/AIBM.Business.Spectator\/homepage", null, "ad-300x250-pos1", { "node_categories": ",", "adposition": "300x250_pos1" }] ] }; When I replace the null value with a dimensions value all the ads come back to life. Google publisher console reports the following error: "Exception invoking function: Cannot call method 'addService' of null" and then errors every ad unit render.
Highlighted

Defining Out of Page Slots in GPT

Tealium Employee
Do you have the "very latest GPT template" as I mention above?
Highlighted

Defining Out of Page Slots in GPT

How do I go about getting the latest GPT template? I'm using Tealium GPT tag and defining variables with mapping. I'd rather not do u.gptSlots.push method and just use the utag_data variable.
Highlighted

Defining Out of Page Slots in GPT

Tealium Employee
The easiest way to use the latest template is to pause your existing tag for GPT. The click "Add Tag" and add another GPT tag.