1

その場で「amp-ad」のサイズを変更しようとしていますが、広告を含む iframe が 300x250 ではなく 1x1 で表示されます

「汎用」クリエイティブで「amp-ad」を使用します ( http://prebid.org/overview/how-to-simplify-line-item-setup.htmlで説明されているように、サイズ 1x1 でセットアップ)。 amp-ad の高さと幅は「300x250」で、広告は 1x1 で表示されます。

<!doctype html>
<html ⚡ lang="en">
<head>
  <meta charset="utf-8">
  <title>AMP Ads</title>
  <link rel="canonical" href="https://www.toto.com/solar.html"/>
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <script  custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-latest.js"></script>
  <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-latest.js"></script>
  <script async custom-element="amp-sticky-ad" src="https://cdn.ampproject.org/v0/amp-sticky-ad-latest.js"></script>
  <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
</head>
<body style="padding:10px">


     <amp-ad width="300" height="250"
              type="doubleclick"
              data-slot="my-data-slot"
              rtc-config='{
  "vendors": {
  "my-vendor": {"additional-infos":"111"}
  }, "timeoutMillis": 999}'
              json='{"targeting":{"test": "test"}}'
      >
        <div placeholder><div style="text-align: center; font-size: smaller; color: gray;">No ads for the moment....</div></div>
      </amp-ad>


<amp-sticky-ad layout="nodisplay">
  <amp-ad width="320" height="50"
          type="doubleclick"
              data-slot="my-data-slot"
              rtc-config='{
  "vendors": {
  "my-vendor": {"additional-infos":"111"}
  }, "timeoutMillis": 999}'
          json='{"targeting":{"test": "test"}}'
  >
    <div placeholder><div style="text-align: center; font-size: smaller; color: gray;">No ads for the moment....</div></div>
  </amp-ad>
</amp-sticky-ad>

DFP のクリエイティブ設定のサイズは 1x1 ですが、300x250 の広告申込情報に関連付けられています

また、amp-ad の代わりにamp-embedを使用したところ、広告は 300x250 にリサイズされました。amp-adamp-embedは同じものの単なるエイリアスであることがわかりましたが、この 2 つの動作は異なっているようです。

残念ながら、amp-embedは amp-sticky では機能しないため、amp-ad タグを使用して広告のサイズを変更する必要があります。

DFP クリエイティブでは、以下を使用しようとしました:

  1. window.context.requestResize : しかし、window.context は未定義です! 機能するwindow.contextを取得するために何が欠けているかを誰かが知っていれば、おそらく私たちの問題は解決するでしょう!

  2. postMessage でも機能しませんでした

  window.parent.postMessage({
    sentinel: 'amp',
    type: 'embed-size',
    width: 300,
    height: 250}, '*');
4

1 に答える 1