2016-04-05 12 views
3

DFP広告をインスタント記事に追加する方法を理解しようとしています。誰もそれについて何か経験がありますか? Facebookでも可能だと言われましたが、DFPやその他の場所ではドキュメントが表示されませんDFPのインスタント記事

答えて

2

ドキュメントによって2通りの方法があります。 https://developers.facebook.com/docs/instant-articles/ads-analytics。私たちは自動配置を使用しました。私たちのアプローチは、広告のためだけに広告(完全なドキュメント)を表示し、必要なiframe srcにURLを使用するルートを作成することでした。体内の

<head> 
    <meta property="fb:use_automatic_ad_placement" content="true"> 
</head> 

:あなたが使用する必要があり、文書の頭の中で

ここ

<header>  
    <figure class="op-ad"> 
     <iframe src="your src" height="250" width="300"></iframe> 
    </figure> 
</header> 
1

がインスタント記事の本文に入れてGPTタグの例です(私が試しましたFacebookのヘルプの例、多くのエラーがあります)

<figure class="op-ad"> 
    <iframe height="250" width="300"> 
     <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> 
     <script> 
      var googletag = googletag || {}; 
      googletag.cmd = googletag.cmd || []; 
     </script> 

     <script> 
      googletag.cmd.push(function() { 
       googletag.defineSlot('/XXXXXX/FB_Articles_300x250', [300, 250], 'div-gpt-ad-XXXXXXXXX-0').addService(googletag.pubads()); 
       googletag.enableServices(); 
      }); 
     </script> 
     <!-- /133801272/FB_Articles_300x250 --> 
     <div id='div-gpt-ad-XXXXXXXXX-0'> 
      <script> 
       googletag.cmd.push(function() { googletag.display('div-gpt-ad-XXXXXXXXX-0'); }); 
      </script> 
     </div> 
    </iframe> 
    </figure> 

この行を瞬時にrticle:いくつかの文脈で

例:

<!doctype html> 
    <html lang="pt-br" prefix="op: http://media.facebook.com/op#"> 
    <head> 
     <meta charset="utf-8"> 
     <link rel="canonical" href="https://yoursite/your-article/"> 
    <meta property="fb:use_automatic_ad_placement" content="true"> 

     <meta property="fb:article_style" content="default"> 

     <meta property="op:markup_version" content="v1.0"> 
    </head> 
    <body> 

     <article> 
      <header> 
       <!-- cover --> 
        <figure class="op-ad"> 
    <iframe height="250" width="300"> 
     <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> 
     <script> 
     var googletag = googletag || {}; 
     googletag.cmd = googletag.cmd || []; 
     </script> 

     <script> 
     googletag.cmd.push(function() { 
      googletag.defineSlot('/XXXXXX/FB_Articles_300x250', [300, 250], 'div-gpt-ad-XXXXXXXXX-0').addService(googletag.pubads()); 
      googletag.enableServices(); 
     }); 
     </script> 
     <!-- /133801272/FB_Articles_300x250 --> 
     <div id='div-gpt-ad-XXXXXXXXX-0'> 
     <script> 
      googletag.cmd.push(function() { googletag.display('div-gpt-ad-XXXXXXXXX-0'); }); 
     </script> 
     </div> 
    </iframe> 
    </figure> 
           <figure> 
         <img src="https://yoursite/your-article/image.jpg" /> 

             </figure> 

       <!-- The title and subtitle shown in your Instant Article --> 
       <h1>Title;</h1> 

       <!-- author(s) --> 
       <address> 
        Writen by <a>Author</a> 
           </address> 

       <!-- publication date/time --> 
       <time class="op-published" datetime="2016-08-16T17:47:42+00:00">16 ago 2016</time> 

       <!-- modification date/time --> 
       <time class="op-modified" datetime="2016-08-16T17:47:42+00:00">16 ago 2016</time> 

      </header> 

<!-- Article body goes here (CONTINUE LIKE A NORMAL INSTANT ARTICLE) --> 
関連する問題