Skip to content

Instantly share code, notes, and snippets.

@aforwark
Created April 11, 2012 21:04
Show Gist options
  • Save aforwark/2362569 to your computer and use it in GitHub Desktop.
Save aforwark/2362569 to your computer and use it in GitHub Desktop.
Companion ad tag on video view.tpl
{if $companion == true}
<script language="javascript" src="http://www.googletagservices.com/tag/static/google_services.js"></script>
<script type="text/javascript">
if(typeof(gnm_ord)=='undefined') gnm_ord=Math.random()*100000000000000000;
adSlot1 = googletag.defineSlot('/4403/gn.sk.sheknows.com/vast', [300, 250]);
adSlot1.addService(googletag.companionAds());
adSlot1.addService(googletag.content());
googletag.content().setContent(adSlot1, "<iframe src='http://n4403ad.doubleclick.net/adi/gn.sk.sheknows.com/vast;sect=vast;sz=300x250;ord=" + gnm_ord + "?' width='300' height='250' marginwidth=0 marginheight=0 scrolling=no></iframe>");
googletag.enableServices();
</script>
<div style="width:300px; height:250px;">
<script type="text/javascript">
googletag.display('/4403/gn.sk.sheknows.com/vast', [300, 250]);
</script>
</div>
{else}
{$ad300x250}
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment