Menu

How can we run custom PHP file in Blogger


PHP stands for Hypertext Preprocessor. PHP is scripting language, can be useful to create dynamic contents and server side activities.  It can be used in combination with various web template systems, CMS and web frameworks.


Why not in Blogger?

However, Blogger platform is not supporting PHP language and many bloggers facing many difficulties to customize and implementing some new and latest developments.

Nothing to worry, because we will approach a tricky way to run php file in blogger. By applying this steps you can show the PHP file executed output in blogger hosting websites.



How can we run custom PHP file in Blogger?

Though, the results are not 100%, but it is far better than not having a PHP code on your blogger site. In this article, we will learn how to run PHP codes in Blogger.

So now I’m going to share a Step by Step guide to teach all of you How can we run custom PHP file in Blogger Blog.


STEP 1 – Creating A PHP File

For using PHP codes in blogger, You have to create a PHP file in which you have to add your PHP codes which you would like to use. Before save it, You have to check it carefully that file you have created is error free, otherwise designs would not look good.

Below I’ve added a simple example of PHP code for beginners which will give a message of Hello Bloggers.

< ?php echo "Hello Bloggers"; ?>

After creating a file make sure that you are saving it by using .PHP extension. For example : hello-bloggers.php. You can create PHP files using any text editors, I have used visual studio editor.


STEP 2 – Find A Free Hosting Website For PHP Code Files

As I’ve mentioned above blogger platform does not give you the facility of placing PHP files. 

Therefore, you have to either host it on your hosting (if you have) or you can use Google Drive to host them for FREE. You can also use Dropbox, and many other free hosting services but certainly they are not better than the features and reliability of Google Drive.


STEP 3 -Adding PHP Code Link in Blogger

After following above steps, Login to Blogger Account >> Select your blog in which you want to run PHP codes >> select your post/page.

You have to paste the following code anywhere you would like to show the gadget, can be added in Sidebar, Footer, Header, Posts or Pages.


<object data="http://examples.com/php-script/hello-bloggers.php" height="400" type="text/html" width="800"></object>


Don’t forget to replace http://examples.com/php-script/hello-bloggers.php with your PHP file URL that you have uploaded to any hosting site like Google Drive or Dropbox.

That’s it.

Congratulations, Now you have successfully added PHP codes to blogger. Open your blog and see it live on your blogger site. 


Please feel free to comment here if you have any questions.

How to set access control for your Google blogger

Google Blogger provides us the access control to set the different levels of access, so that audience can use our blog with the given access level. You can control who can read, edit, comment and manage your blog. You can add up to 100 total members, including authors, administrators, or readers. By default blogger is visible to public. We can change access control settings to private or to specify any individuals or a group of users at any time. Be cautious when you change the blog reader access to private or public, the blog will be shown with the specific access. 

Public Access 
Anyone on the web can access and read your blog.

Custom readers access
You can Send invitation link to the list of users to access your pages

To invite readers to your blog: 
  • Sign in to Blogger.
  • In the top left, select a blog. 
  • From the menu on the left, click Settings.
  • Click "Reader Access" and set to Custom Readers.
  • Under "Permissions," click Invite more readers.
  • Enter the email addresses of the people you want to add. You can add multiple emails in comma separated.
  • Click Send.
  • Now the selected emails will receive mails to access the blog pages
Add Authors to your blog 
  • From the menu on the left, click Settings.
  • Under "Permissions," click Invite more authors.
Private to Authors
All authors of your blog can access and read it.

How to Monitor Your Blog

It's good to know about your blog's readers, get comments from them on your popular posts, but it's not enough when strategically growing your blog, you need some more strategy to know more about your current traffic, unique visitors, repeated visitors, most visited pages on your blog, and daily report or monthly report. So monitoring your blog will help to analyze your blog post reports. There are two monitoring options readily available as Google product. They are Blogger Stats and Google Analytics. Lets see one by one in details.

Blogger Stats



Stats is an important feature of the blogger, as it allows you to track your blog's traffic and find out exactly what your audience is looking for. As such, integrated, real-time stats have been one of the most frequently used options in blogger.


Feature Highlights

  • Real-time tracking of your blog, Each time your blog is viewed, you can see the change on your stats almost immediately
  • Insights about your audience. Top search keywords, countries, browsers, and more
  • Great user interface. Beautiful, easy-to-read graphs and charts

Related post:  How to create your own blog

Blog Stats currently provides 4 different types of analysis reports to review your blog statistics.

  1. Overview
  2. Posts
  3. Traffic sources
  4. Audience

Overview
Blog Stats Overview depicts the picture of hourly trending traffics, summary of Todays view's count, yesterday's view count, last month and all time view's counts and your followers count. It also gives the number of posts, chart view and map view Your blog stats.

Posts
Posts depicts the picture of the number of posts viewed from today, yesterday, last month And all time. There will be separate view of post and page view counts

Traffic sources
Traffic sources depicts the picture chart as similar to Posts view, but the result is the Referring URLs.

Audience
Graphical map view of your audience, and the report view to show the count of users against the country. Pageviews by Browsers, Pageviews by Operating Systems Date filters to show the current date, Yesterday, current week, current month and all times.

Google Analytics


Google Analytics is a digital analytics software with its free web analytics service and graphical reporting. It is a Google product that allows you to analyze in-depth detail about your blog posts and visitors. Google Analytics gives you more control over how that data is collected, and the overview of insights with immediate access to the reports

Blogger analytics count on your own visits by default, and they lack many of the new implementations of analytics. Google Analytics uses an entirely different tracking system than Blogger stats. Google Analytics gives you more control over how that data is collected, allowing you to improve its quality. This includes tag placement, custom dimensions, filtering, segmenting, and custom events that help make the data available to you richer, more accurate, and more useful.

How Google Analytics works
Google Analytics (GA) works by the inclusion of a block of JavaScript code on pages in your blog or website. In blogger by default, this javascript code widget will be there, we have to enable this in settings with GA Code. For websites you have to include the block of javascript code in your html header file, created using Analytics property.

How do I set up Google Analytics for Blogger

  1. Create or sign in to your Analytics account:
  2. Go to google.com/analytics
  3. Do one of the following:
  4. To create an account, click Start for free.
  5. To sign in to your account, Click Sign in to Analytics.
  6. Set up a property in your Analytics account. A property represents your website or blog or app, and is the collection point in Analytics for the data from your blog or website or app.
  7. Set up a reporting view in your property. Views let you create filtered perspectives of your data; for example, all data except from your company’s internal IP addresses, or all data associated with a specific sales region.
  8. Follow the instructions to add the tracking code to your blog or website, so you can collect data in your Analytics property. 
  9. Click Setting icon then Property Settings then Tracking Info then click Tracking Code. Now you can see the Tracking ID.
  10. Copy and Past the tracking ID into your blog settings as shown belo.


In your blog dashboard you can see the "Settings" option. Click Others then in this section, you can fill the Analytics ID in your blog then save. With help of this setup you can start monitor the real-time usage of your blog in the analytics account.

Add RSS Feed for Blogger

RSS stands for Really Simple Syndication. RSS shows data refers XML files that automatically get update  information from your blog/website.

Users can bookmark the RSS feed URL in their browser. When a user bookmarked your blog's RSS feed, the latest updated information like newly added posts or updated posts will be fetched by a user’s RSS feed reader. RSS feeds the users about the headlines, summaries, update notices, and links back to articles.

In RSS, user will see brief and basic information about the content of your blog. These are posted in chronological order so that the top entry is the latest published entry. This content is distributed in real time, so on the top results the latest published content will be shown to the user.

Create RSS feed on Blogger Blogspot

In blog we can create RSS Feed using Google's Feedburner. Google's Feedburner is essentially an add-on service for your blog that tracks people who subscribe to your blog using RSS

  1. Heads to Google's Feedburner. Feedburner uses your active Google login session from your browser 
  2. Copy and paste your blog home page url into the box. Then click Next. Feedburner automatically identify the Atom URL(XML content) from your given blog url.
  3. Then in the next screen you can create a unique path to your feedburner
  4. That's it, now you can add your RSS link your newly created Feedburner URL to your blog as RSS link.
  5. When the user bookmark your RSS link they will get the updated posts at top.

Hope you can able to add rss feed for blogger. I have added the RSS using these steps in my blog. You can check by bookmarking the RSS Feed link from this blog. You will get the updated posts whenever I update.

Backup and Restore Blogger Template

With Google Blogger, you can either download current theme's HTML template Or you can upload the already downloaded theme, if you want to use an older version of blogger template. Yes, it's possible. Recently, Google Blogger has made some important changes for better blogging. Backup and Restore is one of the new feature added to blogger.

Steps to Download/Upload template in Google Blogger
  • Go to theme
  • To save a copy of your theme, in the top right, click More icon, and then Backup and then Download.
  • Your Blogger template will be downloaded as .xml file

To upload your backup template or your newly created theme, click More icon, and then Restore

If you are using older version of blogger, then follow the below steps
  • Go to Theme
  • In the top right side Click button Backup/Restore


Hope this post will be useful about new features of Blogger. If you have any doubts, please let me know through comments.