Adding Multiple Exits to Rich Media Ads for use in DoubleClick Studio

Hey Daniel,

So after some trial and error, we figured out how to get DCS to recognize multiple exits from our ad. Here’s what we did:

We followed parts of the initial guide, including adding this code to our head HTML:

<script src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>

Then we added this script to our head HTML:

<script>
    function bgExitHandler1(e) {
      Enabler.exitOverride('Item 1 Exit', 'DESTINATION-URL');
    }
</script>

As our ad had 5 exits, we duplicated the code inside the script tags 5 times and changed ‘bgExitHandlerX’, ‘Item X Exit’, and the destination URL accordingly.

Then, in the items we wanted to function as our different items, we added the following code to the inner HTML of each item:

<script>
document.getElementById('bg-exit1').addEventListener('click', bgExitHandler1, false);
</script>

And again changed the '1’s in the code above to the corresponding exit.

This worked for us and showed up in DCS. Feel free to take this and add it to the original guide if you think it would be useful.

We’ve got a team here using Hype to create display creative on a regular basis - really appreciate how powerful and easy-to-use Hype is. We will only be using it more moving forward, so expect to hear from us again! Thanks.

3 Likes