Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Meteor框架中添加Google双击广告_Javascript_Meteor_Adsense_Google Dfp_Double Click Advertising - Fatal编程技术网

Javascript 在Meteor框架中添加Google双击广告

Javascript 在Meteor框架中添加Google双击广告,javascript,meteor,adsense,google-dfp,double-click-advertising,Javascript,Meteor,Adsense,Google Dfp,Double Click Advertising,我尝试使用来自的相同代码,这对AdSense有效,但对Google DFP代码无效。GoogleJS不会触发标签中的任何代码 Template.sidebar.rendered = function() { $.getScript("//www.googletagservices.com/tag/js/gpt.js", function() { var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];

我尝试使用来自的相同代码,这对AdSense有效,但对Google DFP代码无效。GoogleJS不会触发标签中的任何代码

Template.sidebar.rendered = function() {
  $.getScript("//www.googletagservices.com/tag/js/gpt.js", function() {
  var googletag = googletag || {};
  googletag.cmd = googletag.cmd || [];

  googletag.cmd.push(function() {
  googletag.defineSlot('/58419895/sidebar_large', [300, 600], 'div-gpt-ad-1432029985552-0').addService(googletag.pubads());
  googletag.pubads().enableSingleRequest();
  googletag.enableServices();
 });

 var ads = "<div id='div-gpt-ad-1432029985552-0' style='height:600px; width:300px;'>";
 $("#square-long").html(ads);  
 return googletag.cmd.push(function() { googletag.display('div-gpt-ad-1432029985552-0'); });
 });

};
Template.sidebar.rendered=function(){
$.getScript(“//www.googletagservices.com/tag/js/gpt.js”,function(){
var googletag=googletag | |{};
googletag.cmd=googletag.cmd | |[];
googletag.cmd.push(函数(){
googletag.defineSlot(“/58419895/sidebar_large”,[300600],“div-gpt-ad-143029985552-0”).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
var ads=“”;
$(“#方长”).html(广告);
返回googletag.cmd.push(函数(){googletag.display('div-gpt-ad-143029985552-0');});
});
};

你有没有想过这个问题?没有。。。返回rails:)