Book Image

Magento Search Engine Optimization

By : Robert Kent
Book Image

Magento Search Engine Optimization

By: Robert Kent

Overview of this book

Table of Contents (15 chapters)
Magento Search Engine Optimization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Google Analytics


SEO would be obsolete if there wasn't a way to analyze the flow of traffic onto (and through) our optimized website.

There are many analytics packages out there, but the most popular by far is Google Analytics (http://www.google.com/analytics/).

In order to set up Analytics effectively on our Magento store, we will need to enter our Google Analytics Account Number (tracking ID) in the administration panel. It is also recommended that we activate e-commerce tracking from within our Google Analytics account.

In order to do this, perform the following steps:

  1. Log in to our Google Analytics account and navigate to our particular website's account page.

  2. Click on Admin.

  3. Within this section, we should see three columns: Account, Property, and View. If we wish to find out our Tracking ID, click on Property Settings under the Property column; we can then copy/paste our Tracking ID from here.

  4. To turn on E-commerce tracking, we should click on View Settings within the View section and then scroll down to Ecommerce Settings and ensure that the toggle is set to ON.

  5. Now that we have our tracking ID and have enabled E-commerce tracking in Google Analytics, we should navigate to our Magento administration panel and then go to System | Configuration | Google API | Google Analytics.

  6. Paste in our tracking ID into the Account Number field, set Enable to Yes, and then click on Save Config.

Now that we have set up analytics, we will find a whole plethora of information is now available to us, including the ability to track revenue by source and to work out our most effective conversion paths. We'll look at more advanced tracking methods in Chapter 6, Analyzing and Tracking Your Visitors.

To double-check that our website is calling out the Google Analytics JavaScript code, we can navigate to our home page and then, within the browser, view the page source. Just inside the <body> tag, we should find code similar to the following:

<!-- BEGIN GOOGLE ANALYTICS CODEs -->
// our <script> tag containing our tracking code here
<!-- END GOOGLE ANALYTICS CODE -->

If we do not see this code, it could be that the template file has been edited and the tag that includes our Google Analytics code has been removed. If this is the case, we should double-check our standard template files (1column.phtml, 2columns-left.phtml, 2columns-right.phtml, and 3columns.phtml, usually found within app/design/frontend/[package]/[theme]/template/page) to make sure that these two snippets of code are in place:

  • <?php echo $this->getChildHtml('after_body_start') ?>

  • <?php echo $this->getChildHtml('before_body_end') ?>