1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分のサイトにYouTubeのチャンネル登録のボタンを埋め込む

Last updated at Posted at 2020-04-10

はじめに

YouTubeにログインして、Subscribe Buttonの「ボタンを設定する」で設定します。
下記のURLから飛べます。
https://developers.google.com/youtube/youtube_subscribe_button

設定

オプションの中の「チャンネル名または ID」の所に、自分のチャンネル名または IDを入力します。チャンネル名が分からない人は、IDのボタンを押すと、自分のIDが分かる場所に移動します。
設定したら、プレビューのボタンを押してみて、ちゃんと反映されているか確認できます。
スクリーンショット 2020-04-10 午後4.09.10.png

 細かい設定

  • レイアウトでは、「フル」にすると、トップの画像と名前を表示することができます。
  • テーマでは、「ダーク」にすると、バックグラウンドを黒区する事ができます。
  • チャンネル登録者数では、「非表示」にすると、数字を隠すことができます。

最後に

テーマ、チャンネル登録コードに書いてあるコードを、ご自身のサイトに入れるだけです。

sample.html
<script src="https://apis.google.com/js/platform.js"></script>

<div class="g-ytsubscribe" data-channel="NJTVnetwork" data-layout="full" data-theme="dark" data-count="hidden"></div>

正しく表示されて、ページ遷移できれば成功です。
data-channelの部分を自分の「チャンネル名または ID」に変更すれば、そのまま使えると思います。

1
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?