Posts

Showing posts with the label Google Blogger Tips and Tricks

How to avoid parsing error in Blogger Template editor when adding HTML or Javascript codes

Image
Do you hate it whenever you found a suitable Javascript in the internet and when you copy and pasted it onto your Blogger template editor only to find out that it is giving out parsing error. Errors like it illegal characters for < , >  or  " and all of them needed to be replace with  &lt; , &gt;  or  &quot;  . Well it is not because the Javascript code is incorrect but rather Blogger template codes are in XML and Javascript code works in HTML. XML and HTML code syntax does not play well together. There are two solutions to this. The first solution is to convert the Javascript codes into XML compatible or friendly. To do that, you need to search for online converter like  http://www.blogcrowds.com/resources/parse_html.php . The second solution is to use CDATA tags. Use the tags inside the <script></script> tags. Here is an example. Javascript found in the internet: <script>     Your Javascript codes. ...

How to reformat HTML and Javascript to be readable

Image
This is an online tool to make any compressed or minified HTML or Javascript to be readable format. There are times where the Javascript is compressed in order to minify the file to optimize website loading speed. If you are having trouble trying to make out what is the logic in the script, this tool can help you to reformat it to a readable form. Online Javascript Beautifier

Blogger Template editing resources

Image
A list of links to resources for reference when editing my Blogger template. Widget Tags for Layout Layout Data Tags master list

BlockAdBlock with Google Analytics Integration

Image
There is a feature when you generate the code for BlockAdBlock script where you can integrate the script with Google Analytics events. This is useful to find out how many visitor of your site had ad blockers installed and met with the nagging screen or blocking screen generated by BlockAdBlock script. This is the most simplest Google Analytics event code you can use for the BlockAdBlock script. Note: You must have a Google Analytics account setup and the analytics script already installed in your site for tracking. The code below depends on the Google Analytics script to run. Whenever a visitor that had an ad blocker installed and met with the nagging screen or the block screen, the script will send an event back to your Google Analytics account for logging purposes. The code below is a simple code that will send an event with category "user", event action of "AdBlock" to indicate a visitor with ad blocker installed. And then the event label with a value of "O...

How to Backup Blogger Blog Easily with Windows Desktop Shortcut

Image
This is how you can easily run a backup on your Blogger blog easily by just running Windows desktop shortcuts. This method is not exactly fully automated method where you can configure it to run in scheduled time and save it in a programmed location. However, This method does makes life easier by skipping all the steps going through the Blogger dashboard interface. The idea of this method is to create a Windows desktop shortcut to execute and be presented with the save window dialog and manually rename the backup file and save it to your preferred location. Note:  You need to have Google Chrome browser installed and login to Google Blogger account. Create a shortcut for backing up Blogger Pages, Posts and Comments Step 1 Go to your Windows start menu and look for your Chrome browser. Right click > Send to > Desktop (create shortcut) Step 2 Go to your desktop and edit the shortcut properties. Right click the desktop shortcut > Properties Step 3 Replace the "Target" bo...

A/B Testing Javascript

Image
This is the A/B testing javascript that was published by Google Adsense team in their blog . I find it quite useful for testing other than Adsense ad units. I saved it here for my easy access in case I need it. Who knows the post in their blog might get deleted in future. <script type="text/javascript">     var random_number = Math.random();     if (random_number < .5){         //your first ad unit code goes here     } else {         //your second ad unit code goes here     } </script> There is another example found at the Google Adsense Help page and the code looks like this: Synchronous ad code: <script type="text/javascript">     var random_number = Math.random();     google_ad_client = "ca-publisher-id";     google_ad_width = 728;     google_ad_height = 90;     if (random_number < .5){         google_ad_slot = ...

How to place Adsense ads inside Blogger post

Image
This is how you can insert or place Adsense ad unit inside a Blogger post content. This method uses the Blogger jump break to determine where to place the ad unit. So decide where you want to insert your jump break as it will also determine where your ad will appear. This method will work for both responsive and non-responsive ads too. If you are reading this from my frontpage, go ahead and click the "Read More" link and you can see my demo. Step 1 In your Blogger account, go to Template > Edit HTML Step 2 Click anywhere in the template code and Ctrl+F to bring up the search box. Search for " </body> " text. Step 3 Copy and paste the code below into the template codes before the " </body> " text. <!--**********************************--> <!-- Within Content Adsense Ads:Start --> <!--**********************************--> <b:if cond='data:blog.pageType == "item"'>   <script src='http://ajax.goog...

YouTube RSS feeds url

Image
This is how you can get the RSS feeds from YouTube. By using the url templates provided at the end of this post, just replace the: USER with the YouTube username. (normal YouTube url: https://www.youtube.com/user/ xXxXxX ) PLAYLIST_ID with the playlist ID that appears in your browser url field (normal YouTube url: https://www.youtube.com/playlist?list= xXxXxX ) CHANNEL_ID with the YouTube channel ID in your browser url field (normal YouTube url: https://www.youtube.com/channel/ xXxXxX ) YouTube User Videos RSS Feeds https://www.youtube.com/feeds/videos.xml?user=USER YouTube Playlist RSS Feeds http://www.youtube.com/feeds/videos.xml?playlist_id=PLAYLIST_ID YouTube Channel RSS Feeds http://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID

How to make blog post images responsive in Blogger

Image
This is how you can make all your blog post images responsive to the different screen sizes. Add this line into your Blogger custom CSS section: .post-body img { width: 100%; height: auto }

How to make YouTube embedded videos responsive on Blogger blogs

Image
This is how to make the YouTube embedded videos responsive to screen sizes on a Blogger blog. Add the following CSS styles into the Blogger CSS styles section of the Blogger template: .video-container {      position: relative;      padding-bottom: 56.25%;      padding-top: 30px;      height: 0;      overflow: hidden; } .video-container iframe, .video-container object, .video-container embed {      position: absolute;      top: 0;      left: 0;      width: 100%;      height: 100%; } Then, add additional div class video-container code wrapping around the YouTube embed code: <div class="video-container">       <iframe src="http://www.youtube.com/embed/abcdefghi" frameborder="0" width="560" height="315"></iframe> </div> References, Sources and Credits: http://avexdesigns.com/responsive-youtube-embed/

How to place or insert Adsense ads between blog post and comment in Blogger

Image
This is how to place or insert Google Adsense units or any other online ads right in between the blog post and comments section. This will also make the ad units appear in between posts in archive or label pages. This is a strategic location to enable visitor to spot the ads right after finish reading a blog post. Steps 1. In the template source code, find this piece of code: <b:include data='post' name='post'/> 2. Copy the code below and paste it below the code in step 1. <div> <!-- paste your adsense code here --> </div> 3. Copy your Google Adsense code and paste it between the <div> codes as shown in step 2. 4. Save and reload your blog. Note: After pasted the Google Adsense code, modify the async part a bit. Before: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> After: <script async="true" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"...

How to add breadcrumbs to Google Blogger blog template

Image
This is how to add breadcrumbs to your Google Blogger blog template. The breadcrumbs will enable you to better inform your visitors on navigating around your Blogger blog. The method here involves editing your Blogger template HTML code so make sure you have backup your template first before you proceed with the edits. Got to edit HTML mode of your Blogger blog and follow the instructions below for the edits to add the breadcrumbs into your Blogger blog template. 1. CTRL+F to find this code: <b:include data='top' name='status-message'/> 2. Add the following code below or after it. <b:include data='posts' name='breadcrumb'/> 3. CTRL+F to find this code: <b:includable id='main' var='top'> 4. Replace the above piece of code with the code below <b:includable id='breadcrumb' var='posts'> <b:if cond='data:blog.homepageUrl == data:blog.url'> <!-- No breadcrumb on home page --> <b:els...

How to estimate a minimum pageviews for a targeted Google Adsense earning from CPC and CTR

Ever wonder how many Google Adsense page views you need to earn $100 per month for your website or blog from Google Adsense? These are the calculations that will guide you to plan a target Google Adsense page views to earn your target monthly earning base on your recent CPC (Cost Per Click) and CTR (Click Through Rate). Before you start, you will need to get your CPC and CTR values from your Google Adsense report. You can either use the values based on last month, last 30 days or last 3 months. Lets say for example your values looks something like this: CPC = 0.5 CTR = 1.00% To get an idea of how many page views you will need per month based on the CPC and CTR values to earn $100 per month, this is how the calculation looks like: ((100 / 0.5) / 1.00) x 100 = 20,000 page views In summary: Target page views = ((target earning / CPC) / CTR ) x 100 percent In order to earn $100 per month based on the current CPC and CTR values from your Google Adsense report, you will need at least 20,000 ...

Customizing Blogger blockquote style

Image
This is how to customize the Blogger blockquote style with a simple custom CSS code. Copy and paste this code into the custom CSS section of your Blogger Template Designer. You can customize the fonts and background if you like using CSS codes. blockquote { background: #484B52 ; background-position:; background-repeat:repeat-y; margin: 0 20px; padding: 20px 20px 20px 50px; color:#C7CACF; font: normal 0.9em Helvetica, verdana, serif, Georgia, "Times New Roman"; } .post blockquote p { margin: 0; padding-top: 10px; } References, Sources and Credits: http://www.mybloggertricks.com/2009/11/14-amazing-ways-to-customize-blockquote.html

Customize posts headings and subheadings style with css

Image
Some how my "h2" heading is smaller than my "h3" heading. I am not sure why but it was an easy fix with custom CSS styling. All I need to do is add these codes with the "font-size:18px;" CSS styling I need. For other types of styling, I refer to  http://www.w3schools.com . Examples: Headings .post h2{ css style codes } Subheadings .post h3{ css style codes } Minor Headings .post h4{ css style codes } References, Sources and Credits: http://dailybloggiingtips.blogspot.com/2013/07/how-to-customize-blogger-heading-and.html

Customize Blogger's Template Designer to control the "Read More" font, color and background

Image
This is how to add an extra setting entry into Blogger Template Designer to control the jump break text (usually Read More) font, color and it's background properties. All credits goes to betatemplates.com for the tutorial on how to do this. Steps Step 1: Modify Blogger template Go to "Edit HTML" section and prepare for copy and paste some codes. Step 2: Insert the first piece of code Find "Variable definitions" and you will find /* Variable definitions ==================== Replace the text with these codes: /* Variable definitions ==================== <Group description="Read More" selector=".jump-link"> <Variable name="readmore.font" description="Font" type="font" default="normal normal 12px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 30px 'Courier New', Courier, FreeMono, monospace"/> <Variable name="rm.link.color" description="...

Dynamic meta tags generator for Blogger SEO

Image
This is a cool page that provides you with an interface to easily generates the meta tags use for search engine optimization purpose. All you just need to do is to enter all the necessary details about your website and click generate. Copy the generated code and paste the code into your website source code. References, Sources and Credits: http://htmlmaker.blogspot.com/2013/04/dynamic-meta-tag-to-blogger-for-best-seo.html http://htmlmaker.blogspot.com/p/dynamic-meta-tag-generator.html

Create a Table of Contents for Blogger posts based on atom or rss feeds

Image
This is a Javascript code that generates a table of contents based on your atom or rss feeds. It organizes the post titles based on labels. I use this script for my categories posts. All credits goes to Abu Farhan, the source of this Javascript. References: The Best Table of Contents (TOC) or Sitemap for Blogger Table of Contents for Blogger new style

Blogger post footer elements cannot be rearrange, move or toggle the visibility

Image
Some how my Blogger post footer elements cannot be rearrange, move or even toggle the visibility from the "Blog" widget settings located in the Blogger page elements. I guess this is what happens when you tinker your Blogger template too much and too many times. This is how i manage to fix it. Use "Revert Widget Templates to default" for the "Blog" widget. Note:  After you have revert the widget to default, any previous customization done within the widget code will be lost.

Dynamic meta tags for Blogger with labels as keywords

Image
This is how you can dynamically use Blogger's labels as keywords in your keyword meta tag for each blog post. By using labels as the keywords, you can control meta keywords for each of your blog post pages for search engine optimization purposes. I found this method from www.seocentro.com website. This is how you can do it. Replace the <head> code with the codes below: <!--::::::::::: Block1: Output post meta keywords --> <b:if cond='data:blog.pageType == &quot;item&quot;'>    <b:section id='meta1' showaddelement='no'>    <!-- widget must be a of Type = 'blog' to have posts data exposed, and must have a unique id -->    <!-- Empty Includables(functions) to output nothing, You must keep them ): -->    <b:widget id='Blog2' locked='no' type='Blog'>       <b:includable id='nextprev'/>       <b:includable id='backlinks' var='post'/>       <b:i...