Guernsey Press — GAM Snippets
A pretty, copy‑friendly library of ad code. Snippets are escaped so they won’t run.
Category targeting: category

Billboard Type A — 970×250 & 728×90 on desktop; 300×250 on mobile




<div id="gp_1">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var billboardA = googletag.sizeMapping()
          .addSize([1024, 0], [[970, 250], [728, 90]])
          .addSize([728, 0], [[728, 90]])
          .addSize([0, 0], [[300, 250]])
          .build();
    googletag.defineSlot("/23312316111/gp_b1", [[970, 250], [728, 90], [300, 250]], "gp_1").defineSizeMapping(billboardA).addService(googletag.pubads());
    googletag.display("gp_1"); });
    </script>
</div>

<!-- end billboard type A code -->

Billboard Type B — 970×250 on desktop; 300×250 on mobile




<div id="gp_2">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var billboardB = googletag.sizeMapping()
          .addSize([1024, 0], [[970, 250]])
          .addSize([0, 0], [300, 250])
          .build();
    googletag.defineSlot("/23312316111/gp_b2", [[970, 250], [300, 250]], "gp_2").defineSizeMapping(billboardB).addService(googletag.pubads());
    googletag.display("gp_2"); });
    </script>
</div>

<!-- end billboard type B code -->

Billboard Type C — 970×250 & 728×90 on desktop; 300×250, 300×50, 320×100 on mobile




<div id="gp_3">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var billboardC = googletag.sizeMapping()
          .addSize([1024, 0], [[970, 250], [728, 90]])
          .addSize([728, 0], [[728, 90]])
          .addSize([0, 0], [[300, 250], [300, 50], [320, 100]])
          .build();
    googletag.defineSlot("/23312316111/gp_b3", [[970, 250], [300, 250]], "gp_3").defineSizeMapping(billboardC).addService(googletag.pubads());
    googletag.display("gp_3"); });
    </script>
</div>

<!-- end billboard type C code -->

Billboard Type D — 970×250 & 728×90 on desktop; nothing on mobile




<div id="gp_4">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var billboardD = googletag.sizeMapping()
          .addSize([1024, 0], [[970, 250], [728, 90]])
          .addSize([728, 0], [[728, 90]])
          .addSize([0, 0], [])
          .build();
    googletag.defineSlot("/23312316111/gp_b4", [[970, 250], [728, 90]], "gp_4").defineSizeMapping(billboardD).addService(googletag.pubads());
    googletag.display("gp_4"); });
    </script>
</div>

<!-- end billboard type D code -->

MPU Type A — 300×250 on desktop; 300×250, 300×50, 320×100 on mobile




<div id="gp_5">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var mpuA = googletag.sizeMapping()
          .addSize([1024, 0], [300, 250])
          .addSize([0, 0], [[300, 250], [300, 50], [320, 100]])
          .build();
    googletag.defineSlot("/23312316111/gp_m1", [[300, 250], [300, 50], [320, 100]], "gp_5").defineSizeMapping(mpuA).addService(googletag.pubads());
    googletag.display("gp_5"); });
    </script>
</div>
<!-- end MPU type A code -->

MPU Type B — 300×250 on desktop and mobile




<div id="gp_6">
    <script type="text/javascript">
    googletag.cmd.push(function () {
    googletag.defineSlot("/23312316111/gp_m2", [[300, 250]], "gp_6").addService(googletag.pubads());
    googletag.display("gp_6"); });
    </script>
</div>
<!-- end MPU type B code -->

Monster MPU Type A — 300×600 on desktop; 300×250 & 300×600 on mobile




<div id="gp_mm1">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var mmpuA = googletag.sizeMapping()
          .addSize([1024, 0], [300, 600])
          .addSize([0, 0], [[300, 250], [300, 600]])
          .build();
    googletag.defineSlot("/23312316111/gp_mm1", [[300, 250], [300, 600]], "gp_mm1").defineSizeMapping(mmpuA).addService(googletag.pubads());
    googletag.display("gp_mm1"); });
    </script>
</div>
<!-- end Monster MPU type A code -->

Monster MPU Type B — 300×600 on desktop; nothing on mobile




<div id="gp_mm2">
    <script type="text/javascript">
    googletag.cmd.push(function () {
          var mmpuB = googletag.sizeMapping()
          .addSize([1024, 0], [300, 600])
          .addSize([0, 0], [])
          .build();
    googletag.defineSlot("/23312316111/gp_mm2", [[300, 600]], "gp_mm2").defineSizeMapping(mmpuB).addService(googletag.pubads());
    googletag.display("gp_mm2"); });
    </script>
</div>
<!-- end Monster MPU type B code -->
Tip: In your global GAM setup, consider calling googletag.pubads().collapseEmptyDivs(); if you want empty slots to collapse.