개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
YouTube Subscribe Button를 사용하면 모든 페이지에 Subscribe
버튼을 추가할 수 있습니다. 이 버튼은 YouTube 채널로 연결됩니다. 버튼을 클릭하면 사용자가 구독을 확인할 수 있도록 새 창에서 YouTube 채널 페이지가 열립니다.
버튼을 추가하려면 애플리케이션이 다음 JavaScript 파일을 로드해야 합니다.
https://apis.google.com/js/platform.js
그런 다음 class
을 g-ytsubscribe
로 설정하고 다른 속성을 사용하여 버튼을 맞춤설정하는 <div>
과 같은 요소를 사용하여 버튼을 추가할 수 있습니다. 다음 코드는 GoogleDevelopers 채널의 Subscribe
버튼을 표시하는 간단한 통합을 보여줍니다.
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channel="GoogleDevelopers"></div>
Google+ JavaScript API를 사용하여 버튼을 동적으로 렌더링할 수도 있습니다.
구성 옵션
아래 버튼에는 정기 결제 버튼의 다양한 레이아웃과 구성 옵션이 표시됩니다. 표준 채널의 버튼은 구독자 수와 함께 또는 구독자 수 없이 표시됩니다.
버튼 언어 기본값은 사용자의 언어 설정을 따르며 로그아웃한 사용자의 경우 위치를 기반으로 합니다.
표준 채널
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[null,null,["최종 업데이트: 2025-08-21(UTC)"],[],[],null,["# Overview\n\nThe YouTube Subscribe Button lets you add a `Subscribe` button to any page. The button links to a YouTube channel. Upon clicking the button, the YouTube channel page opens in a new window so that the user can confirm the subscription.\n\nTo add a button, your application needs to load this JavaScript file: \n\n```\nhttps://apis.google.com/js/platform.js\n```\n\nYou can then add a button by using an element, such as a `\u003cdiv\u003e`, that sets its `class` to `g-ytsubscribe` and uses other attributes to customize the button. The following code shows a simple integration that displays a `Subscribe` button for the GoogleDevelopers channel. \n\n```\n\u003cscript src=\"https://apis.google.com/js/platform.js\"\u003e\u003c/script\u003e\n\u003cdiv class=\"g-ytsubscribe\" data-channel=\"GoogleDevelopers\"\u003e\u003c/div\u003e\n```\n\nYou can also use the [Google+ JavaScript API](/+/web/api/javascript) to render a button dynamically.\n\nConfiguration options\n---------------------\n\nThe buttons below show different layout and configuration options for subscription buttons. Buttons for standard channels are shown with and without subscriber counts.\n\nThe button language defaults to the user's language settings or is set based on the user's location for logged-out users.\n\n### Standard channels\n\n| Buttons ||\n|-------------------------------|---|\n| Default button | |\n| Default button | |\n| Full layout (includes avatar) | |\n| Full layout (includes avatar) | |\n| Full layout, dark theme | |\n| Full layout, dark theme | |"]]