Web Site Design Blog

Blog Category: Social Networking
February 7, 2013

YouTube Creator's Corner Buttons and Badges

Creator’s corner provides buttons for visitors to quickly subscribe or follow you on YouTube. When you click the button it instantly gives you the code to copy and paste into your website source code for visitors to follow your YouTube account. Pretty simple, right?

As a service to my customers I often add this social button to other peoples websites. The problem is that it always links to my YouTube account and there doesn’t appear to be any options to change that behavior so it would link to my clients YouTube account instead of mine.

To get the code to work correctly for my client required a little hacking.

First get the code for the button linking to my account.

<a href=”//www.youtube.com/subscription_center?add_user_id=F9Cq_tFEaoq95VbC77q7WQ&feature=creators_cornier-//s.ytimg.com/yt/img/creators_corner/Subscribe_to_my_videos/YT_Subscribe_130x36_red.png”><img src=”//s.ytimg.com/yt/img/creators_corner/Subscribe_to_my_videos/YT_Subscribe_130x36_red.png” alt=”Subscribe to me on YouTube”/></a><img src=”//www.youtube-nocookie.com/gen_204?feature=creators_cornier-//s.ytimg.com/yt/img/creators_corner/Subscribe_to_my_videos/YT_Subscribe_130x36_red.png” style=”display: none”/>

See the part where it says:

add_user_id=F9Cq_tFEaoq95VbC77q7WQ

This is the part that is of interest to us.

I don’t know what user id this is for the account I need to link it to. It isn’t the same as the users Google+ id. I believe it may be a user id specific to YouTube.

Now go to the feed page on YouTube of the person who you want to associate the button with.

Use your browser to view the HTML source code.

Search for ‘user_id’ and you will find some code that looks like this.

<input type=”hidden” name=”user_id” value=”8GpGdrx6SMBVUIecN0-9mw”>

Now replace the add_user_id=F9Cq_tFEaoq95VbC77q7WQ in the button code with the value found here value=”8GpGdrx6SMBVUIecN0-9mw“.

I hope this helps someone else who needs to do the same thing.