13 April 2013

Improvements to Blogger Template HTML editor

Previously I wrote a post about how to integrate Facebook comments with blogger and I received a lot of question about how to modify the positioning of the comment box. Particularly as some people have used highly customized blogs or used the new dynamic blog templates.

Anyway, Blogger summer interns have posted about two new features that should make finding and re-positioning code slightly easier. One is a formatting feature that makes the code indentation nicer and uniform across the whole template and the second feature is a menu which takes you to the code of a widget with a single click.

You can read the full post on the two links below(they are identical posts)

Autopost YouTube Videos (Uploads) to Blogger using Google FeedBurner

There are many easy ways to post your YouTube videos to Blogger using third party tools/websites such as ifttt.com, however the method I explain here relies solely on Google products (YouTube, FeedBurner and Blogger).

1. Enable posting to Blogger via Email

1.1) Login to Blogger.com

1.2) Browse to the section shown in the screen shot below:
1.3) Enter a secret word for your auto blogging via email.

1.4) Click "Save settings" to make the changes permanent.

From now on you will be able to create blog posts via sending emails to this secret email address.

2. Find the URL of the RSS feed for your YouTube uploads

This is an example my YouTube account so make sure you replace my username(jenson) with that of your own.

This is the URL of my YouTube uploads which retrieves them as an RSS XML file. Replace my name(jenson) with the name of your YouTube channel.
http://gdata.youtube.com/feeds/base/users/jenson/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile

here is a simpler alternative URL for the same purpose:
http://gdata.youtube.com/feeds/base/videos?orderby=published&author=jenson

3.  Add your YouTube RSS URL to Feedburner


3.1) Go to feedburner.google.com


3.2) Enter the URL from step 1 into the only text box on the webpage, as shown in the screen shot below:

3.3) Click Next and you will see the screen below:


3.4) On the above screen you can safely ignore the given options(As these can be changed later if you wish to do so). So click next once more and you will be presented with the below screen:


3.5) Click Next once more and you will see the screen below:


3.6) In the above screen you can ignore all options and click next. (I have checked all the available options to be able to see some more stats about the feed but this is irrelevant to what we are doing here). So click Next one last time!

4. Enable Email Subscription for your newly created RSS feed on Feedburner

4.1) Click on the "Publicize" tab and you will see the screen below:

4.2) Click on "Email Subscription" link on the left hand side and you will see the screen below:
4.3) On the above click the activate button to enable this feature. You will see a success message as shown below:


4.4) Click the RSS icon in the top left corner to view your newly created Feed(e.g. http://feeds.feedburner.com/JensonTaylor) on feedburner. You will be presented with the page displayed below(containing a list of your YouTube uploads. I have cut the screenshot short):

4.5) Click on the link that reads "Get Videos delivered by email". A popup will appear, so make sure it is not blocked by a pop-up blocker.

5. Subscribe to your FeedBurner RSS Feed using your secret Blogger email

5.1) Enter your secret blogger email address in the popup window and click "Complete Subscription Request" button:

4.6) You will then see a confirmation message which you can dismiss it by clicking on the "close window" link:

6. Confirm the subscription

Once you have subscribed to the feed on feedburner, an automatic blog post will be made to your blog that looks like the following:

6.1) Click on the confirmation link in the above Blogger post (which was automatically created on your blog)

6.2) Go to your blogger interface and delete this blog post because it will no longer server a purpose and it makes your blog look bad. 

7. Enjoy

From now on any YouTube video that you upload to your channel will be posted to your blog.

Potential Problems:
  • Updates can take up 48 hours to happen but not longer(This is the worst case scenario) because:
    • Feedburner emails are only sent once every 24 hours(The time of day that emails are sent can be chosen by you)
    • YouTube API extracts your uploads through its search mechanism which lags behind the uploads of users, hence the extra delay in this part as well
  • The unsubscribe link is displayed at the bottom of the blog post so anyone of your blog readers can stop this from happening on the next occasion. 
  • The emails that are sent to Blogger create ugly blog posts which look a bit spammy, although you can modify the email content to some extent through Feedburner(see below).

Tips

1. In step 1 of this guide you can choose the "Save emails as draft post" option in the settings which means your posts will not be automatically posted to your blog but saved as a draft blog instead which means you can review it and modify it before you actually post it. One important editing task here would be to remove the details at the bottom of the email/post which allows public readers of your blog to unsubscribe your blog from receiving these auto posts.

2. I recommed changing the Feedburner email title to something more suitable as shown on the screenshot below:
I have marked where you need to click and what you can enter to change the email title and logo. I believe it's easy to follow and also I am feeling lazy so I haven't explained it in more details but if you need clarification please let me know. 

As always any questions, suggestions or comments are most welcome.

29 March 2012

Useful Google Analytics Dashboard for Bloggers

Google Analytics Dashboard for Blogspot, Wordpress or any content website
I previously wrote a blog post about using Google Analytics with Blogger. So if you have become familiar with Google Analytics and you feel comfortable using it, you might want to add some better reporting tools that will help you view the stats of you blog in a more friendly way. So here is a nice dashboard that selects a few items to report on. Following this link will give you the option to add this new dashboard to your Google Analytics profile: Add Cool Blogger Dashboard

Assuming you are already logged into Google Analytics you will see a popup like the one shown below:
1. Select you blog profile (e.g. bloggerpost3.blogspot.com) then
2. Select "Create Dashboard"

You will be able to see a pretty neat dashboard that is already setup and ready to use as shown below (The screen shot below is from another blog) as I have only recently setup Google Analytics for my personal blog there wasn't enough data to make the dashboard look good:


One of the nice features of this dashboard view is that you can see the stats against the page titles as opposed to seeing the stats against an obscure URL address.

28 March 2012

Blogger Stats vs. Google Analytics - Report Very Different Values

This is follow up post on Using Google Analytics with Blogger Tutorial. I encourage everyone to use Google Analytics instead of Blogger Stats however when people make the switch the first question everyone asks is why is there such a big difference/drop in Google Analytics stats versus Blogger Stats. In particular the Blogger stats shows much larger number for page views than Google Analytics.

Before I go into details, I like to point out that Google Analytics is showing the "more" correct statistics of user activity on your blog.

The major difference in statistics between Google Analytics and Blogger Stats comes from the method they use to track page views and visitors. Google Analytics uses a more accurate method by setting a cookie on the user's browser which means the user is most likely to be a real user as opposed to an automate computer program.
There are many automated computer programs that visit your blogs on regular basis(known as bots) that fetch your content in order to create an index for search engines such as Google, Yahoo and Bing. Google Analytics will not recognize these as valid visits whereas Blogger Stats counts each one of these as a valid visit. Aside from search engines viewing your blog there are many other automated programs that are designed for spamming and email harvesting that visit your blog. These visits are added up to your Blogger Stats, therefore inflating your ego visitor numbers.

If you have previously used solutions other than Blogger Stats, other factors can contribute to a difference in numbers such as their use of third party images or third party cookies. Some statistic-collection websites place a small image on your blog such as a counter or their logo or even a transparent image. Every time that image is loaded a "hit" or "page view" is recorded on their servers. Whereas Google Analytics only counts a "visit" to the same page if it's not within the same 30 minutes.

It's also worth knowing that some security programs such as firewalls and anti-viruses change the settings of your browser to stop these third party images from loading which means even more incorrect statistics are recorded.

Also, it is worth pointing out that Blogger Stats will record your visits to your own blog. So disabling this feature is a great help toward getting more consistent statistics across Blogger Stats and Google Analytics, even though Google Analytics also records your visits to your own blog. You can find the procedure on how to disable tracking your own visits to your blog below however since the country code domain name changes have gone live, disabling tracking will not be as accurate as it was before the top level domain name changes.

You can find more information on this topic via the Google Help pages.

Stop Tracking your own views
For bloggers that have very popular blogs, it will not make a noticeable difference whether you track your own visits to your blog or not. However if your blog doesn't get that many views then your own visits could account for a large portion of page views on your blog. Hence it is important to stop tracking your own views in Blogger Stats. So:

1. Go to your Blog dashboard
2. Click on "Stats" (Overview)
3. Click on "Don't track your own pageviews" as shown in the screenshot below


4. You will be presented with a popup, select the "Don't track my pageviews" option.


5. Click "Save"

and you're done!


If you'd like to be updated on new blog posts please subscribe to my RSS feed and/or via email.

27 March 2012

Blogger Service Unavailable Error 503 after top level domain name changes (country code extensions)

I previously wrote about how Google Blogger has changed top level domain names (country codes) for censorship purposes. After these recent changes to Bloggers' country code domains, I have experienced a lot of 503 Server Errors. The changes to the country domain name extension coincided with other changes rolled out by Blogger such as Search Preferences for SEO optimization. So it is not clear where the 503 errors stem from but it appears that other users/bloggers are experiencing the same problem.

If you have seen this error please leave a comment so that I know, I am not the only one!
Blogger Error 503 Service Unavailable
HTTP 503 Service Unavailable Error means the server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.


Here is the HTML code returned by the Blogger servers:
<HTML><HEAD><TITLE>Service Unavailable</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"><H1>Service Unavailable</H1><H2>Error 503</H2></BODY></HTML> 

It's interesting to see the error pages served by Blogger servers do not comply to HTML 4 standards.

24 March 2012

Guide to YouTube Captions (Subtitles) and Transcripts Tutorial

If you have viewed videos on YouTube you have probably noticed a small icon marked as "cc" in the bottom bar of the video player(See the image below)


If video owners upload captions(subtitles) for their videos, you will be able to select from a range subtitles based on language or whatever variation of subtitles(captions) the video owner provided. However for most videos on YouTube, nobody uploads the subtitles so YouTube has a voice recognition software that attempts to provide subtitles for English spoken videos. I must point out that although the automatic speech to text feature is technologically impressive, it is not adequate from a user's perspective.

Creating subtitle files is a fairly time consuming process, however creating a transcript is much less work. Because you don't need to set start/stop times for each piece of text which you would need to do for subtitles. So if you have a transcript of your video you can upload it for your video and not only will YouTube provide an interactive transcript of your video(accessible via an icon below your video) but the automatic speech recognition software by YouTube will use this same transcript for the subtitle captions. So the subtitle captions will be 100% accurate. YouTube does a very good job at matching the transcript to the audio so the timing of subtitles appearing on your video will be in sync with the audio itself.

Transcript Toggle: shows the transcript as video is playing.
There might be very rare occasions where the timing of the audio and a subtitle caption is not perfect, however this can easily be fixed. All you need to do is follow the steps below (This guide assumes you have uploaded your transcript file otherwise there will be an auto-generated one which will be fine as well):

1. Go to your video.
2. Click the "Edit captions/subtitles" link above your video (this will take you to another page)

3. Click on your caption link which will be something like "English - your transcript name" (this will take you to another page)

4. In the bottom right corner of this page you will see a button which says "Download" click this button to download the "caption/subtitle" file. (Note: you never uploaded a subtitle/caption file, YouTube create this file from your transcript file) save this file on your computer.

5. Open the download file using Notepad or your favorite text editor.

6. You will see that each line of text has two sets of times above it, these times indicate at what point in your video the subtitle will appear and at what point it will disappear. Change the times to match your video.

Here is an example:
0:00:01.000,0:00:05.200Weakness of attitude becomes weakness of character.
7. Bring back your browser now and click on the link "Return to All Tracks

8. Click the "Add new captions or transcripts" button

9. Choose the subtitle file.

10. Make sure the option selected is "Caption file(includes time codes)" this is the default option so you shouldn't need to change anything here.

11. Select a name for the captions. I usually call it "subtitles (captions)" because when your video starts it will show the language name of your subtitles with this text appended to it for about 2 seconds.

12. Click "Upload file"



and you're done.

Assuming you have a transcript for your video, this is by far the easiest method for providing subtitles/captions for your videos. If you don't have a transcript for your video you can download the auto generated captions then edit them and upload the new file to fix any errors that YouTube had produced.

Here is an example video that I created:



Applications for Subtitling / Captioning your YouTube Videos
Alternatives to the above method exist in the form of software that look like video editing applications. Using this software you will need to play the video then pause it, type in a sentence for the caption and set when it should disappear. I have tried a few of such applications and I can tell you they are all really time consuming. But if you would like to try one these application, here are a few:

Online Captioning Websites:
Desktop Applications

Tools and approaches aside, here are some usability guidelines for creating subtitles: http://www.dcmp.org/ciy/

You might also find these YouTube help files useful:

Uploading YouTube Transcript File Tutorial

Just in case anyone has problems with this, I made this small addition to the how-to guide for uploading a transcript file. Here are the steps:
  1. Go to your video
  2. Click the "Edit captions/subtitles" link above your video (this will take you to another page)
  3. Click the "Add new captions or transcripts" button
  4. Choose your transcript file
  5. Select the option "Transcript file"
  6. Select a name for the Transcript
  7. Click "Upload file"


Subscribe to RSS feed or via email

Integrate Facebook Comments for Blogger Tutorial

Display Facebook comments on your blog and let Facebook users comment on your blog without signing up for Blogger or other services.

This tutorial assumes that you have a Facebook account and a Blogger account with a blog.

1. First you need to create a Facebook App for your blog. In order to do this go to https://developers.facebook.com/apps 

2. In the top right of your screen click on the "+ Create New App" button as shown in the screen shot below:
3. You will be presented with the screen below in which you need to choose:
  • A name for your app which can be anything you like; I have chosen "JT Blog Comments"
  • A namespace for your app this can be anything you like as well but it must be in all lower case letters without any spaces. Don't worry about what these attributes do, but just know that they are necessary for any Facebook App.
  • Do NOT tick the web hosting option. This is not necessary for our comment application.
Once you have entered all the details click "Continue"

4. You will then be asked to pass the "captcha" test. i.e. type in the letters in the image in order for Facebook to verify that you are a human and not a spamming computer program. Enter the correct letters or numbers the click "Submit".

4.a) If you have not setup your Facebook account with a mobile phone number you will see the message below. If you don't see the message below skip to step 5 (that means you have already setup your account with a mobile telephone). For those of you - such as myself - who come across this message, click on the link in the red box which says "mobile phone".


4.b) You will then see the screen below;

  • Select your country
  • Enter your mobile phone number
  • Then click the "Confirm" button



4.c) You will be taken to the page below and at the same time receive a text message(SMS) on your mobile phone. Enter the code from the SMS you received on your mobile phone in the box and click "Confirm"


4.d) You will then see a success message as shown below stating that your account has been verified. Close this page and go back to where you left off when you came across the popup at step (4.a).


4.e) Follow instructions in step 3 again.

4.f) Follow only the first part of step 4 which is only entering the skewed text displayed in the image. Then jump to step 5.

5. You will see the page displayed below;

  • Make a note of your App ID or copy it
  • Where is says "App Domain" enter "blogspot.com". (If you host your blog on your own domain name then enter your domain name here)
  • In the "Website" section where it says "Site URL" enter the address of your blog e.g. "http://bloggerpost3.blogspot.com"
  • Click "Save Changes"


6. After saving the changes to your Facebook app, you will see a confirmation message in a yellow box at the top of the webpage.

Now your Facebook App is ready. Just make a copy of the App ID as you will need this number when integrating the Facebook comment application into your blog.

7. Change the code below by replacing FACEBOOK-APP-ID with your Facebook App ID number which  you copied at step 5.
<meta content="FACEBOOK-APP-ID" property="fb:app_id" />
So my modified code looks like this: 
<meta content="336995009681830" property="fb:app_id" />
8. Go to your blog dashboard on Blogger.com; Select "Template" then click on "Edit HTML" as highlighted in the screenshot below:


9. You will receive a popup with a few options. Click on the "Proceed" button as shown below:


10. You will then see the code in your template. Try to locate the <head> tag as shown in the screen below:


11. Just below the <head> tag paste your modified code from step 7. Here is how my code looked like after this change:

12. Click "Save Template"

13. Now you need to add some more code to your template (this is the actual code for the Facebook comment section below your blog posts). Go to you blogger dashboard for your blog then select "Template" > "Edit HTML" > "Proceed" to view your HTML code (i.e. follow steps 8 and 9)


Update 21/04/2013: Since 11th of April 2013 step 14 is no longer necessary. This check-box has been removed and instead each widget can be expanded using an arrow to the left of it. Also there is a drop down menu at the top of the editor which allows you to select the widget that you want to scroll to in one click.
14. Tick the "Expand Widget Templates" checkbox as shown below:

15. Find the code below in your template code using Ctrl-F shortcut and paste the code into the search box.  Warning: Do NOT try to type the text below as your web browser could freeze.
<div class='post-footer-line post-footer-line-3'>
The screenshot below shows how it would look:

If you were able to find the tag that you searched for jump to step 16.

15.a) Depending on the blogger template that you are using it is possible that the above search fails. In that case search for this tag:
<p class='post-footer-line post-footer-line-3'> 
15.b) if the search at step 15.a failed then search for the following tag:
<data:post.body/>
16. Paste the code below immediately after the tag you found at step 15(or 15.a xor 15.b)
<b:if cond='data:blog.pageType == "item"'> <div id="fb-root"></div> <script>(function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; d.getElementsByTagName('head')[0].appendChild(js); }(document));</script> <fb:comments width='450' colorscheme='light' expr:title='data:post.title' expr:href='data:post.canonicalUrl' expr:xid='data:post.id'/> </b:if>
So the resulting code would look like this:
Optional: To change the width of your comment box in the code above change width="450" to whatever you see suitable for your blog.

Optional: To change the color scheme of your comment box you can change the word "light" to "dark" for the attribute colorscheme='light' which gives you the two coloring schemes available for Facebook comment boxes.

17. You now need to add the Facebook Namespace declaration in your code. If you go the top of your code you will see a tag as <html as shown below:


You need to add the code below right after the <html tag
xmlns:fb="https://www.facebook.com/2008/fbml"
So it would look like this instead: 
<html xmlns:fb="https://www.facebook.com/2008/fbml"
Here is a screen shot of the code after the change:
Note: The namespace added in the code above is used for all Facebook widgets and apps. So you only need to add this into your code once, regardless of how many different FBML widgets you use.

18. Click "Save Template"

19. Click "Close"

20. Enjoy!


Moderating comments, Administration options and housekeeping
Visit this URL http://developers.facebook.com/tools/comments in order to view all the posted comments on your blog. This is the screen you will see:


If you click the "Settings" link on the above page you will be presented with a few options that are self explanatory such as adding Moderators for your blog or allowing users with different logins to leave comments(e.g. Yahoo or Hotmail logins). Here is a screenshot of the settings page:

Removing Blogger Comments
Although I would not recommend to anyone that they remove blogger's default commenting feature, if you choose to do so you can easily hide or show it from your blogs dashboard by going to

  1. Settings 
  2. Posts and comments 
  3. Comment Location then select "Hide"
  4. Make sure to click "Save Settings"


If the screenshots are too small to read, you can click on them to enlarge them.

If you run into any problems, let me know in the comments' sectio.



UPDATE (17/01/2013)

Adding a Facebook Comment Section For Stand Alone Pages on Blogger

If you have a stand alone page then the above procedure for adding Facebook comments will not work as the above approach only applies for blog posts and not "pages". So in order to obtain the Facebook comment section on stand alone pages you need to follow the steps below in addition to the above steps. (Note that the steps below need to be repeated for every single page whereas the above guide which only includes blog posts will cover all your blog posts. Note 2; blog posts and blog pages are two different things)

1. Go to your page then select "Edit" as shown in the screen shot below:

2. Once you go through to the edit page, look at the URL in the address bar at the top of your browser. You will see an address similar to this:

http://www.blogger.com/blogger.g?blogID=363170316363135703#editor/target=page;pageID=1979633926023450196

3. Make a note of the last number from the URL address. (This will be unique to your own page so don't copy the number I have shown here.) In my example the number is 1979633926023450196.

4. Click on the "HTML" tab as shown on the screen shot below:

5. Now you will see the HTML code behind your page. Go to the bottom of this code and "Cope & Paste" the following text:

<div id="fb-root">
</div>
<script>(function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; d.getElementsByTagName('head')[0].appendChild(js); }(document));</script> <fb:comments colorscheme="light" href="http://bloggerpost3.blogspot.com/p/jenson.html" title="Blog" width="450" xid="1979633926023450196"></fb:comments>

6. The above code is an example used for one my blog pages so you have to change 3 parts that are highlighted (in red) in the above code to suit your own blog page.
6.a. The URL of your blog page. (In my example it's http://bloggerpost3.blogspot.com/p/jenson.html)
6.b. The title of your page. (In my example it's Blog)
6.c. The page id of your page. This is the number that you made note of in step 3. (In my example it's 1979633926023450196)

7. After you have entered the code in your page it should look like the below screen shot so just press update and your page should be ready for facebook comments.


If the screenshots are too small to read, you can click on them to enlarge them.

If you run into any problems, let me know in the Facebook comments' section ;)