LoginSignup
3
2

More than 5 years have passed since last update.

AMPページでオーバーレイ広告(アンカー広告)を表示する

Last updated at Posted at 2017-10-26

<head>タグ内で

<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<script async custom-element="amp-sticky-ad" src="https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js"></script>

を記述し、広告表示、オーバーレイ実装のAMPライブラリのスクリプトを読み込みます。

<body>タグ直後に下記のAMPタグを記述します。

<amp-sticky-ad layout="nodisplay">
  <amp-ad
    type="adsense"
    width="320"
    height="50"
    data-ad-client="ca-pub-xxxxx">
  </amp-ad>
</amp-sticky-ad>

以上で、AMPページにおいて、オーバーレイ広告(アンカー広告)を表示されます。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2