diff --git a/dfp.module b/dfp.module
index b603d41..196105e 100755
--- a/dfp.module
+++ b/dfp.module
@@ -412,6 +412,15 @@ function dfp_tag($machinename) {
           '#weight' => -1,
         );
       }
+      if(!$tag->short_tag){
+        $render_array['#attached']['js'][] = array(
+          'data' => 'googletag.cmd.push(function() {googletag.display("'.$tag->placeholder_id.'");});',
+          'type' => 'inline',
+          'group' => JS_DEFAULT,
+          'weight' => 99,
+          'scope' => 'footer'
+        );
+      }
     }
   }
 
diff --git a/theme/dfp_tag.tpl.php b/theme/dfp_tag.tpl.php
index 0dd89d7..790ec3c 100644
--- a/theme/dfp_tag.tpl.php
+++ b/theme/dfp_tag.tpl.php
@@ -9,9 +9,4 @@
   <?php if (isset($slug)):
     print drupal_render($slug);
   endif; ?>
-  <script type="text/javascript">
-    googletag.cmd.push(function() {
-      googletag.display("<?php print $tag->placeholder_id ?>");
-    });
-  </script>
 </div>
