The 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.
You can then add a button by using an element, such as a
<div>, that sets its
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.
<script src="https://apis.google.com/js/platform.js"></script> <div class="g-ytsubscribe" data-channel="GoogleDevelopers"></div>
The buttons below show different layout and configuration options for subscription buttons. Buttons for standard channels are shown with and without subscriber counts.
The button language defaults to the user's language settings or is set based on the user's location for logged-out users.