Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.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
在Facebook即时文章中添加DFP双击_Facebook_Ads_Google Dfp_Facebook Instant Articles - Fatal编程技术网

在Facebook即时文章中添加DFP双击

在Facebook即时文章中添加DFP双击,facebook,ads,google-dfp,facebook-instant-articles,Facebook,Ads,Google Dfp,Facebook Instant Articles,如何在Facebook即时文章中添加DFP广告?我使用双击服务 我需要知道我应该在“图”中添加什么的示例: <figure class="op-ad"> <!-- Use this for your ads --> <iframe src="https://www.adserver.com/ss;adtype=banner320x50" height="50" width="320"></iframe> </figure>

如何在Facebook即时文章中添加DFP广告?我使用双击服务

我需要知道我应该在“图”中添加什么的示例:

<figure class="op-ad">
    <!-- Use this for your ads -->
    <iframe src="https://www.adserver.com/ss;adtype=banner320x50" height="50" width="320"></iframe>
</figure>

谢谢

我建议使用,但要注意将整个广告标签放在iFrame中(而不是调用head元素)。下面是一个例子:


var googletag=googletag | |{};
googletag.cmd=googletag.cmd | |[];
(功能(){
var gads=document.createElement(“脚本”);
gads.async=true;
gads.type=“text/javascript”;
var usesssl=“https:”==document.location.protocol;
gads.src=(使用SSL?“https::“http:”)+
“//www.googletagservices.com/tag/js/gpt.js”(http://www.googletagservices.com/tag/js/gpt.js%E2%80%9D);
var node=document.getElementsByTagName(“脚本”)[0];
node.parentNode.insertBefore(gads,节点);
})();
googletag.cmd.push(函数(){
googletag.defineSlot(“/1234/travel/asia/food”、[300250]、“div-gpt-ad-123456789-1”).addService(googletag.pubads()).setTargeting(“abc”、“xyz”).setTargeting(“123”、“456”);
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
googletag.cmd.push(函数(){googletag.display(“div-gpt-ad-123456789-1”);});

AdPlugg允许您执行此操作。您上面的代码将变成:

<figure class="op-ad">
    <!-- Use this for your ads -->
    <iframe src="http://www.adplugg.com/serve/<your_adplugg_access_code>/html/1.1/index.html?zn=fb_zone_1" height="50" width="320"></iframe>
</figure>

然后从你的AdPlugg账户中,你可以从谷歌上下载你的标签。你也可以在联盟网络广告、你自己的直销广告等中轮换

这应该是你所需要的一切,但如果你愿意,你可以在我发布的博客中阅读更多关于如何设置Facebook即时文章广告的内容:


免责声明:我为AdPlugg工作

使用GPT准备DFP集成静态HTML文件,如下所示:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}</style>
<script type="text/javascript">
  (function() {
    var useSSL = 'https:' == document.location.protocol;
    var src = (useSSL ? 'https:' : 'http:') +
        '//www.googletagservices.com/tag/js/gpt.js';
    document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
  })();
</script>
<script type="text/javascript">
    googletag.defineSlot('/YOUR_DFP_ACCOUNT_NUMBER/YOUR_ADUNIT_CODE', [300, 250], 'div-gpt-ad-1459514019072-0').addService(googletag.pubads());    
    googletag.enableServices();
</script>

</head>

<body>
<div id="div-gpt-ad-1459514019072-0">
    <script type="text/javascript">
        googletag.display('div-gpt-ad-1459514019072-0');
    </script>
</div>
</body>

</html>

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,缩写词,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,dd,ol,ul,li,fieldset,form,label,ledge,table,table,table,table,title,tbody,tfoot,thead,tr,th,th,td,article,article,side,canvas,detail,detail,bed,bedded,str,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font size:100%;font:inherit;vertical align:baseline}article,side,details,figcaption,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line height:1}ol,ul{list style:none}blockquote,q{blockquote:none}blockquote:before:before,q:在{content:'';content:none}表{边框折叠:折叠;边框间距:0}
(功能(){
var usesssl='https:'==document.location.protocol;
var src=(使用SSL?'https:':'http:')+
“//www.googletagservices.com/tag/js/gpt.js”;
文件。写(“”);
})();
googletag.defineSlot(“/YOUR_DFP_ACCOUNT_NUMBER/YOUR_ADUNIT_CODE”,[300250],“div-gpt-ad-1459514019072-0”).addService(googletag.pubads());
googletag.enableServices();
谷歌标签显示('div-gpt-ad-1459514019072-0');
将其保存并存放在类似

现在使用Facebook即时文章(FBIA)广告语法调用此URL:

<figure class="op-ad">
    <iframe height="250" width="300" src="http://example.com/fbia-banner.html"></iframe>
</figure>

并使用FBIA测试工具对整个页面代码进行测试

注:

  • 使用像这样的代理文件并不是最好的解决方案,如果有一个直接的DFP URL提供服务会更好。我尝试了DFP简化的url标记,但它不适合在FBIA中使用

Facebook抱怨iframe标签上有“宽度”和“高度”属性,你应该删除它们

我尝试了简化的url标签,在facebook即时文章中显示了创意,但它不可点击,因为它只有创意而没有clicktag(有人有解决方案吗?我还尝试了通过GPT将DFP与adunit集成在一起的静态HTML文件。但它不起作用。。。