The YouTube Subscribe Button lets you add a one-click Subscribe button to any page. The button lets people subscribe to your YouTube channel without having to leave your site to either log in to YouTube or confirm their subscriptions.

To add a button, your application needs to load this JavaScript file:


You can add a button by using an element, such as a <div>, that sets its class to g-ytsubscribe and uses other attributes to customize the button. The code below 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>

You can also use the Google+ JavaScript API to render a button dynamically.

Note: If the channel associated with the button is a paid subscription channel, the button links to the channel rather than subscribing users automatically.

Configuration options

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.

Standard channels