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.

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

    https://apis.google.com/js/platform.js

You can then 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 following code shows an 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
[`gapi.ytsubscribe` JavaScript methods](https://developers.google.com/youtube/subscribe/reference#Dynamic_Rendering)
to render a button dynamically.

## Configuration options

The following buttons show different layout and configuration options for
subscription buttons. Buttons for standard channels are shown with and without
subscriber counts.

<br />

The button language defaults to the user's language settings or is set based on the user's location for logged-out users.

<br />

### Standard channels

<iframe src="https://developers.devsite.google/frame/youtube/subscribe/index_d2beaf48e2d3769a8cf4fc0c6fc99b8ea43b930639574c317a086baba1efe75f.frame" class="framebox inherit-locale " allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>