Coding Series: Part I – How To Install Google Analytics

Leverage Archive

Woah! We've been at this a long time. What was true a year or two ago may not be true today. If you're interested in something a little more current, take a look at our recent blog posts.

Interested in seeing what the best digital marketing group can do for you? Request an evaluation of your marketing.
Evaluate my marketing now!

This is the first post in what will likely be a five-part instructional series on valuable codes that can easily be installed, and if done so correctly, Google Analytics will provide substantial insight into your website traffic and your return on advertising dollars.

Google Analytics is one of Google’s free tools that allows advertisers to customize over 80 reports to track all activity on their website. Advertisers can gain key insights into what visitors do and how those actions contribute to the success of their business through these customizable reports focused on visitors, traffic sources, content, goals, and ecommerce.

Code Implementation: Google Analytics

Signing up for Google Analytics is simple and free, with four easy steps to complete before accessing a world of analytics. Go to https://www.google.com/analytics/provision/signup to get started. Once the account is set up, you can find your personal code snippet within the Profile Settings of your Google Analytics account.

To access your tracking code from Google Analytics:

  1. Log in at http://www.google.com/analytics.
  2. Select the profile from the accounts Overview page.
  3. From that profile’s Actions column, click ‘Edit.’
  4. At the top right of the ‘Main Website Profile Information’ box, click ‘Check Status.’
  5. The tracking code can be copied and pasted from the text box in the Instructions for Adding Tracking section.

Code snippet sample:

<script>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl/.” : “http://www.”);
document.write(unescape(“”));
</script>
<script>
try{
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
pageTracker._trackPageview();
} catch(err) {}
</script>

For basic installation, copy and paste the code segment into the bottom of your content, immediately before the </body> tag of each page you are planning to track. You will need to update the “xxxx-x” in the sample above with your own Google Analytics account number.

Gauging Performance: Google AdWords with Google Analytics

In Adwords, a user’s action is labeled a “conversion,” whereas the same activity in Analytics is listed as a “goal.” In order for Google Analytics to calculate goal conversion metrics, you must create one or more goals.

Before setting up a goal, make sure you have the following requirements.

  • Name the goal: Specify a name that you will recognize when viewing the goals within your reports. Examples of names you might use include ‘email sign-up’ or ‘article ABC download.’
  • Define the funnel: While funnels are optional, defining one can help you map where visitors drop off during the path to completing a goal.
  • The value of the goal: Google Analytics uses an assigned goal value to calculate ROI, Average Score, and other metrics.

Setting up goals:

  1. Select the account that you’ll be creating goals for from the Overview page of Google Analytics.
  2. Find the profile for which you will be creating goals, and click ‘Edit’ under the ‘Actions’ column.
  3. Under the ‘Goals’ section, select one of the four sets to create the goal (each set contains up to five goals) and click ‘Add goal.’
  4. Enter the goal’s name so that you can quickly recognize it when viewing reports.
  5. Turn the goal ‘On’ or ‘Off.’
  6. Select the goal’s position. The pull-down menu allows you to select a goal’s position in a set so that you can control the order in which it appears from the ‘Goals’ tab in your reports.
  7. Decide which one of the three types of goals you want. This can be URL Destination, Time on Site, or Pages/Visit.
  8. Once you select the radio button for the goal type, a field for ‘Goal Details’ should appear.

Here’s a great example from Google on how to set the value of a goal:

“The value of the goal: Google Analytics uses an assigned goal value to calculate ROI, Average Score, and other metrics. A good way to value a goal is to evaluate how often the visitors who reach the goal become customers. If, for example, your sales team can close 10% of people who request to be contacted, and your average transaction is $500, you might assign $50 (i.e. 10% of $500) to your “Contact Me” goal. In contrast, if only 1% of mailing list signups result in a sale, you might only assign $5 to your “email sign-up” goal.”

Defining funnels:

After entering goal information, define a funnel if you’ve selected a ‘URL Destination’ goal type:

  1. Click ‘Yes, create a funnel for this goal.’
  2. Enter the ‘URL’ of the first page of your conversion funnel. This page should be one that is common to all users working their way towards your goal.
  3. Enter a ‘Name’ for this step.
  4. If this step is a ‘Required step’ in the conversion process, select the checkbox to the right of the step. If this checkbox is selected, users reaching your goal page without traveling through this funnel page will not be counted as conversions.
  5. Continue entering goal steps until your funnel has been completely defined. You may enter up to 10 funnel steps or as few as a single step.
  6. Click ‘Save Changes’ to create this goal and funnel.

Linking your AdWords account to Google Analytics will allow you to take advantage of extensive reporting options. It will also enable you to spot further ad opportunities by viewing AdWords conversions alongside Analytics goal/transactions. You can obtain detailed tracking information by creating customized statistics that will allow you to calculate return on investment.

To link:

  1. Add your AdWords username to your Analytics account as an Account Admin.
  2. In AdWords, select Reporting tab and choose ‘Google Analytics.’
  3. Select ‘I already have a Google Analytics account.’
  4. From the Existing Google Analytics Account drop-down menu, select the name of the Analytics account.
  5. Then, select ‘Link Accounts.’

Google Analytics is a smart web analytics solution that enables you to analyze website performance, gauge the effectiveness of your marketing campaign, and create better-performing advertisements. To find out more visit: http://www.google.com/analytics/. If you have any other questions about the functionality of Google Analytics or how to install the code, please feel free to contact us or follow up with your Leverage Marketing account manager.