Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

How to Embed Google Products to Your Joomla-Powered Site

Submitted by on October 13, 2009 – 3:34 pm3 Comments

Google delivers a lot of products and services that can be helpful for your site. Moreover, many of them are specially adopted for Joomla.

I think there is no need to re-invent the wheel if the existing one meets the challenge! So, this article is devoted to embedding of useful Google products to the Joomla-powered site.

Currently there are 9 Google which works with Joomla-powered websites:

This tutorial is about Google Analytics, Google Calendar, Google AdSense and, of course, Google Maps. Let’s begin!

Google Analytics

Seems that Google Analytics is the best service for site analysis as for beginners as well for SEO professionals now.

The simplest way to use Google Analytics for your website is to bring Google Analytics data into your site. To do this you should:

  1. Get register in Google and add a website into your Google account;
  2. Get the code of the counter provided by Google. It can look like:

    <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=’" + gaJsHost + "google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-6008457-1"); pageTracker._trackPageview(); </script>

  3. In the root folder of your site, open

    ../templates/template_name/Index.php

    where template_name is a name of the template used for the site;

  4. Insert the Google code to index.php within <body> (usually, it is at the end of the file but before </body> and </html> HTML tags).

You will get access to Google Analytics reports (such as number of page visits, sources of visits, keywords, entry points, types of browsers and screen resolutions, languages, visitors’ country etc.) after approximately 5 hours of usage tracking.

Google also provides the Google Analytics extension for Joomla (GAnalytics). Its main features are:

  • Many different variations of the data combinations, e.g. visitors per country, browsers a day,  etc;
  • Modules which are showing the data at module positions;
  • Easy import of google analytics accounts;
  • Easy add your google analytics tracking code through a plugin;
  • Use of google cache mechanism to increase the performance.

If you wish to use it, please do:

  1. Download mod_html;
  2. Go to your Joomla Administration Panel;
  3. Navigate to Extensions -> Install/Uninstall;
  4. Within Upload Package File area, click Browse;
  5. Look for the mod_html zip file on your computer;
  6. Click Upload File & Install;
  7. After the module is installed go to Extensions -> Module Manager;
  8. Select mod_html from the list and click Edit;
  9. In the module parameters, place your javascript or html code;
  10. Click Save after done.

That’s all!

Google Calendar

Google Calendar is presented as an extension for Joomla. This extension offers a component which shows Google calendars inside a Joomla based web page. It is simple to configure and has a nice integration into the web site, one way is the standard Google view and the other a fully customizable Joomla view, based on Google calendar feeds.

  1. The calendar sources will be where you place the HTML/XML code given to you from Google. Just name it for you to find later, and then place the HTML code. (The XML is not used yet.)
  2. Create a new calendar. Here you can specify the options for the calendar and then click on "Add Calendar" at the bottom. You can then choose the calendar that you’ve added (as a source earlier). You can also specify the color for that calendar. This component supports multiple-calendars so you can continue to add calendars and choosing colors. Then click save. You should see a list of the calendars you’ve created.
    NOTE the ID next to the calendar you want to create a link to on the front side.
  3. Go to the menu you want to add the link to – add a Link Component, on the next screen on the right you should see a Component Parameters. Click this drop down and here you enter the calendar ID.

That’s it.

Google AdSense

The first thing to do to insert Google Adsense into your website is get register in Google and add a website into your Google account. Then you will be able to create a code of a Google Adsense banner in the settings of Google Adsense panel.

Having the Google code, you should embed it to the webpage. I propose three ways to do this.

Edit index.html

  1. In the root folder of your site, open

    ../templates/template_name/Index.php

    where template_name is a name of the template used for the site;

  2. Insert the Google code to index.php within <body>.

Use a special extension

Install a special extension – module, plugin or component – created for embedding Google advertising banners to Joomla-based websites. Configure it following the instructions.

Google map

You cannot correctly embed Google map to the webpage because of some tags that aren’t supported by Joomla. But there is a trick! You will need some programming skills to use it.

Create a new article. Configure it as you need but leave the body empty.

Then open jos_content table (this is its default name) within the database and find the created article there. Insert the Google code to the Intro Text and to the Full Text (optional) fields.

Now you have correctly working Google map on your website. Though, keep in mind that you have to edit this article through database only.

Thank you and good luck!

3 Comments »

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.