Welcome to the first post in a series of seven on how to optimize Google Analytics (GA) to track your local search engine optimization project. Working with as many ‘local search’ clients as we do it is important for us to get the most information about our local search campaigns as quickly and efficiently as possible from Google Analytics. This series describes a sequence of steps we take to customize and optimize Google Analytics to best serve our needs.

It wasn’t easy to pick the simple name for this series just to let you know. Other options included ‘How to Pimp Out Google Analytics for Local Search’ and ‘The First in a Septagonal Literary Novella Regarding Silicon Valley-Based Google’s Analytical Programming and How Said Programming May Equate to a Dire Need to Reconsider Your Stone Age Point of View on Such Exigent Commodities as Local Search.’

In this post we are going to describe how to track traffic from Google Universal’s local results which get embedded into to the organic results pages. These results are commonly called the one-pack, three-pack, or ten-pack depending on how many local results are included (typically with a map) on the organic search results pages. Martijn Beijk has on excellent article on exactly this topic on Mike Blumenthal’s blog. This article expands on Martijn’s first of two options for tracking local traffic from Google’s Universal Search (GUS) results . Of course if you are not yet ranking in the local Google Universal results, you may want to check out this article on Local Search Ranking Factors first. The steps to properly track and analyze your local traffic from Google’s Universal Search results are:

1. Use a ‘local vanity’ URL as your URL in your Google Local Business Center listing

2. Create a ‘tracking’ URL

3. Set up a redirect to 301 redirect your vanity URL to a real ‘tracking’ URL

4. Update your GA Snippet to allow # instead of ? to denote URL parameters (or use the canonical element)

5. Configure Advanced Segmentation in GA to view results

1. Use a ‘local vanity’ URL as your URL in your Google Local Business Center listing
You need to use a different URL in your Local Business Center (LBC) listing so that you can track the traffic that comes from your listings. This is also another opportunity to ‘optimize’ your listing further as I typically recommend using the city name you are targeting as the ‘vanity’ sub-directory. For example seOverflow uses http://www.goinflow.com/denver as the URL in our LBC listing.  In step 3 we’ll cover the fact that at this point the URL you just made up returns a 404 error since the page doesn’t exist.

2. Create a ‘tracking’ URL
We are going to be treating local traffic from GUS as a ‘campaign’ in order to track users properly in Google Analytics. GA provides a URL builder tool where you can integrate the necessary campaign tracking variables into your URL with ease. Head on over to the tool and fill in the variables as shown here (substitute your main url for seoverflow.wpengine.com):

url-builder2

Campaign Source: google

Campaign Medium: localpack

Campaign Name: google-universal-local

Now copy the URL that was generated and change the ? to a #. Your URL should look like this.

http://www.yourdomain.com/#utm_source=google&utm_medium=localpack&utm_campaign=google-universal-local

3. Set up a redirect in htaccess to redirect your vanity URL to a real ‘tracking’ URL

At this point you’ve got a local ‘vanity’ URL that doesn’t go anywhere and a tracking URL not in use yet. You’ve got to tie the two pieces together and here is how. We need to 301 redirect the vanity URL to the tracking URL. In order to do this (assuming you are using an Apache web server) you should add this line of code to your .htaccess file:

redirect 301 /vanityurl http://www.yourdomain.com/#utm_source=google&utm_medium=localpack&utm_campaign=google-universal-local

That’s it! If you are not using a web server where you can edit an htaccess file to place this redirect, check other resources for help on creating 301 redirects.

4.  Update your GA Snippet to allow # instead of ? to denote URL parameters

Traditionally URL parameters such as those found in your tracking URL come after a ? in the URL.  However we replaced the ? with a # remember?  The reason we did this is search engines such as Google don’t consider URLs with # in them as ‘duplicate content’, saving us from any future problems. Now we need to tell Google Analytics about our change so that it can still track our campaign properly as by default it is expecting a ?. To do this, add the line in bold to your current Google Analytics tracking code snippet.

<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-XXXXXXXX-X”);
pageTracker._initData();
pageTracker._setAllowAnchor(true);
pageTracker._trackPageview();
</script>

Alternatively you could not change the ? to a #, and not add the line to your GA code. In this case to prevent a duplicate content problem you can make use of the newer canonical URL element by placing this code in the head section of your landing page:

<link rel="canonical" href="http://www.yourdomain.com"/>

5. Configure Advanced Segmentation in GA to view results

Now finally comes the fun part. You get to use GA’s new Advanced Segmentation feature to view stats about your visitors who clicked on a local Google Universal Search result to get to your site. First you need to create an Advanced Segment to identify the visitors. To do this, first click on the box next to ‘Beta Advanced Segments’ at the top right of your Dashboard page then click ‘Create a new advanced segment’.

beta-advanced-segments

Now you are on the Create Advanced Segment screen. Click the traffic sources drop down under the ‘Dimensions’ menu on the left. Drag the ‘Campaign’ box to where it says ‘dimension or metric’ on the left. Leave Condition as ‘Matches Exactly’ and then enter ‘google-universal-local’ as the value. Name the segment towards the bottom ‘Local Universal Search Traffic’ and click ‘Create Segment’.

advanced-segment

Now that you have an advanced segment established, you can view data for your visitors who belong to this segment right along side the numbers for ‘all visitors’ or any other segment. To do this click on the ‘Beta Advanced Segments’ box again then place a check mark next to your new Custom Segment and click apply.

select-advanced-segment

You’ll notice the keywords people used to find your local Google Universal Search listings don’t show up in the Traffic Sources -> Keywords report. You can find the keywords that were used by going to Traffic Sources -> Campaigns -> google-universal-local and then choosing the ‘Keyword’ dimension from the drop-down.

Thanks for sticking with this somewhat detailed and technical post. In the next installment we’ll discuss how to take a deeper look at what visitors from your ‘region’ or at least the regions you are most interested in are doing on your site.

*Disclaimer – by following the steps above you will not only be collecting data on visitors from Google’s Local Universal Search results, but you will also be tracking visitors directly from Google maps as well. In our experience most of the traffic comes from the GUS results and not Google Maps, but proceed at your own risk.

seOverview: Local Edition
If your local business is not ranking well in Google’s local ‘ten-pack’ when someone is searching for the products or services you offer in your area, you may be missing out on hundreds of customers or more each month. Yahoo Local and other local directories are also very important sites on which to have presence. Learn more!

About 

Mike has been honing his internet skills since the early 90s, in both corporate and start up environments. Today, Mike’s companies, Inflow and its sister company, ConversionIQ, make Search Engine and Conversion Optimization available and affordable to companies of all sizes.