Optimize 3.0 Inbound Marketing Blog

How to create Video XML Sitemap for Embedded YouTube Video

Posted by Doug Kirk  Jun 13, 2011 11:45:00 AM

 

Free Online Sitemap Generator

I recently embedded Youtube videos on my site and wanted to be sure they were seen by Google.   So I checked into XML video sitemap specifically for YouTube embedded video.  There are plug ins that do this for Wordpress but nothing for non-wordpress sites.  There are XML vides sitemap generators out there, but I couldn’t confirm they worked with YouTube.   What’s really interesting is that Google owns YouTube, but it’s not straightforward how to build an XML Video Sitemap for YouTube Videos on a non-Wordpress site.  It basically boils down to indentifying two things an XML Video Sitemap requires: Player Location and Content Location.   Did some research and it took some time, but got it nailed and wanted to share the steps here (I owe a lot to www.4blogger.com):

1)      Go to YouTube.com where your video is located.  You will need your video ID which is located at the end of the URL and is 11 characters.

YouTube Video ID example resized 600

 

2)      Go to Linkedtube.com follow these steps:

 

  • Enter your YT video ID in the top box
  • Enter your “button text” this is what appears at the top of the video player
  • Button URL is the complete YouTube URL of your video should look something like this: http://www.youtube.com/watch?v=CQ8Nhac9MW4&feature=related
  • Button mode: Show Always
  • Hover title is what you want to appear when users hover over the top button.  Use some brief descriptive text about the video
  • Hover text: I’ve no idea what this does.  Leave blank.
  • Click Save & Get Code

Using LinkedTube for XML video sitemap1 resized 600

Get & Save Code:

Using LinkedTube for XML video sitemap2 resized 600

 

3)      Take the embed code and put this on your site.  This will be your video player.  Here’s what it looks like on my site Optimize 3.0.  Keep this code handy as we will need it as we build the XML Video sitemap.

Optimized YouTube video player on Optimize 3.0 resized 600

 

4)      Build your XML Video Sitemap.  Google Webmaster has instructions and examples as well.

This is the code structure example right from Google.  You can copy this and use as a template.  The highlighted portions represent the code we will customize in the next step.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"

xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">

<url>

<loc>http://www.example.com/videos/some_video_landing_page.html</loc>

<video:video>

<video:content_loc>http://www.site.com/video123.flv</video:content_loc>

<video:player_loc allow_embed="yes" autoplay="ap=1">http://www.site.com/videoplayer.swf?video=123</video:player_loc>

<video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>

<video:title>Grilling steaks for summer</video:title>

<video:description>Get perfectly done steaks every time</video:description>

<video:rating>4.2</video:rating>

<video:view_count>12345</video:view_count>

<video:publication_date>2007-11-05T19:20:30+08:00.</video:publication_date>

<video:expiration_date>2009-11-05T19:20:30+08:00.</video:expiration_date>

<video:tag>steak</video:tag>

<video:tag>meat</video:tag>

<video:tag>summer</video:tag>

<video:category>Grilling</video:category>

<video:family_friendly>yes</video:family_friendly>

<video:duration>600</video:duration>

</video:video>

</url>

</urlset>

 

The highlighted areas above need to be customized as follows:

a) This is the URL location of the video on your site:

<loc>http://www.example.com/videos/some_video_landing_page.html</loc>

Update with the URL where the video resides on your site (examples are the URLs on my site):

My site: <loc>http://www.optimize3point0.com/inbound-marketing-agency-nyc//</loc>

b) This is where the LinkedTube player comes in – to get the video content location.  Go back to the video embed code you grabbed from LinkedTube.   Replace the highlighted portion below with the URL for the LinkedTube player.  You know which one it is since it has your YouTube Video ID appended to it.    

<video:content_loc>http://www.site.com/video123.flv</video:content_loc>

My XML Video sitemap: <video:content_loc>http://www.linkedtube.com/static/flash/player.swf?X8K29dEyyeY</video:content_loc>  

c) Next we need to update the code with the video player location.  We will use the LinkedTube video player info again.

<video:player_loc allow_embed="yes" autoplay="ap=1">http://www.site.com/videoplayer.swf?video=123</video:player_loc>

My XML Video sitemap:

<video:player_loc allow_embed="yes" autoplay="ap=1">http://www.linkedtube.com/static/flash/player.swf?X8K29dEyyeY</video:player_loc>

 

d) To get a YouTube Video thumbnail.  Type in this URL into your browser:  

http://img.youtube/vi/(your YouTube video ID)/0.jpg

 

To get other images:

http://img.youtube/vi/(your YouTube video ID)/1.jpg

http://img.youtube/vi/(your YouTube video ID)/2.jpg

http://img.youtube/vi/(your YouTube video ID)/3.jpg

 

Choose one you like and update the XML Video sitemap code accordingly:

<video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>

What mine looks like:

 <video:thumbnail_loc>http://img.youtube.com/vi/X8K29dEyyeY/3.jpg</video:thumbnail_loc>

 

5)  Remaining video tags.  We’ve identified the hard one previously when it comes to embedded YouTube videos.  Now we can address the other aspects of the XML Video Sitemap.  The required tags are as follows (more fully defined by Google Webmaster).   

<video:title> The title of the video. Limited to 100 characters.

<video:description> The description of the video. Descriptions longer than 2048 characters will be truncated.

<video:duration> You can see the duration of your video right on YouTube. The duration of the video in seconds.  Value must be between 0 and 28800 (8 hours). Non-digit characters are disallowed.

<video:tag> A tag associated with the video. Tags are generally very short descriptions of key concepts associated with a video or piece of content. A single video could have several tags, although it might belong to only one category. For example, a video about grilling food may belong in the Grilling category, but could be tagged "steak", "meat", "summer", and "outdoor". Create a new <video:tag> element for each tag associated with a video. A maximum of 32 tags is permitted.

<video:category> The video's category. For example, cooking. The value should be a string no longer than 256 characters. In general, categories are broad groupings of content by subject. Usually a video will belong to a single category. For example, a site about cooking could have categories for Broiling, Baking, and Grilling.

<video:family_friendly> I trust it is. 

I hope you’ve made it this far.  Here’s my final code that I was able to upload to my webmaster account:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"

        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">

<url>

  <loc>http://www.optimize3point0.com/inbound-marketing-agency-nyc//</loc>

    <video:video>

      <video:content_loc>http://www.linkedtube.com/static/flash/player.swf?X8K29dEyyeY</video:content_loc>

      <video:player_loc allow_embed="yes" autoplay="ap=1">http://www.linkedtube.com/static/flash/player.swf?X8K29dEyyeY</video:player_loc>

      <video:thumbnail_loc>http://img.youtube.com/vi/X8K29dEyyeY/3.jpg</video:thumbnail_loc>

      <video:title>Optimize 3.0 Inbound Marketing</video:title>

      <video:description>Optimize 3.0 a certified Hubspot Inbound Marketing Agency. Social media implementation for B2B. Video Optimization</video:description>

<video:publication_date>2011-05-31</video:publication_date>

      <video:tag>Inbound Marketing</video:tag>

      <video:tag>Social Media</video:tag>

      <video:tag>Video Optimization Example</video:tag>

      <video:tag>Doug Kirk</video:tag>

      <video:tag>Embedded YouTube Video</video:tag>

      <video:category>Inbound Marketing</video:category>

      <video:family_friendly>yes</video:family_friendly>

      <video:duration>45</video:duration>

    </video:video>

</url>

</urlset>


6)      Upload the code into your site.  This step depends on how your CMS is managed.  Once it’s there go to your Google Webmaster Tools account and click on Site Configuration > Sitemaps > Submit a Sitemap.   You will be prompted for the URL on your site where the XML Video Sitemap is located.   Hit submit and Google will tell you pretty quickly if it was successful.

Try this XML Sitemap Generator:

 Have Optimize 3.0 review your site for video sitemap optimization opportunities and more suggestions:

Button free 10 point website evaluation

Try the Optimize 3.0 Blog Value Calculator:

Button what's your blogging worth 

Topics: Blogging Tips, YouTube, Video SEO, XML Video Sitemap, seo