Google Analytics Setup Guide
Google Analytics Setup Guide
JS Second Edition
GOOGLE ANALYTICS
SETUP GUIDE
TABLE OF CONTENTS
Step 1: Create A Google Analytics Account................................................................Page 4
Step 2: Analyze Your Website...........................................................................................Page 5
Step 3: Create A Profile, Filter, and Goal........................................................................Page 6
Step 4: Add Tracking Code To Your Website...............................................................Page 12
Step 5: Link Google Analytics and Google AdWords........................................................Page 13
Step 6: Configure E-Commerce Tracking.....................................................................Page 15
Step 7: Tag Your Advertising Links.................................................................................Page 20
Best Practices........................................................................................................................Page 23
Analytics Resources...........................................................................................................Page 24
You may not know it, but you have just taken the first steps to increasing the
success of your online channel. Our goal is to help you set up Google Analytics
correctly so you can make sound business decisions.
Second, take your time. While it is true that a basic implementation of Google
Analytics can happen in minutes, your specific implementation may be different.
Read through this guide thoroughly and get acquainted with the concepts. Then
go back and see how these concepts apply to your site. Come up with an
implementation plan and at the very least, spend a week working on your Google
Analytics installation.
Finally, ask questions. If there is something you do not understand, or that needs
clarification, contact us. Remember, you are going to use the data in Google
Analytics to make important business decisions. If the configuration is incorrect,
then the data could be wrong. Use SiteScan to verify your installation once you
are finished.
Good luck!
The Team
Existing Google AdWords customers can It is easy for new customers to sign up for a
sign up for Google Analytics via their Google Analytics account in a few simple
AdWords account. Once in your account, steps.
click on the “Analytics” tab and follow the
instructions. Sign up now at [Link]/analytics.
Websites are built using many different technologies. Some of these technologies complicate
the Google Analytics Installation. Our guide is meant to walk you through a basic Google
Analytics setup. If your site has any of the elements listed below, you may need more help than
what is contained in this guide. If you need further help, please contact us to get information on
our support plans at [Link] or visit the Google Analytics Help Center
at [Link]
Google has provided a library for tracking With the emergence of new web technologies
Adobe Flash and Flex interactions using it is now possible for visitors to interact with a
native AcionScript 3 code. For more webpage instead of just view the webpage. It
information concerning Flash and Flex is possible to track this interaction through
tracking, visit the resources section at the Event Tracking by using the _trackEvent()
end of this guide. method. For more information concerning
Event Tracking, visit the resources section at
the end of this guide.
If your site crosses multiple domains you will The Google Analytics tracking code will
need to add the _link() or the _linkByPost() need to be placed in the <head> section of
method on all links and forms that take a user the parent HTML file and also any child
from one domain to another. For more HTML pages. Without careful
information concerning cross domain implementation you could see inflated visitor
tracking, visit the resources section at the numbers and lose referring source
end of this guide. information. For more information on
tracking websites with frames, visit the
resources section at the end of this guide.
3. This will bring you to the Create New Website Profile page.
4. Choose between the two options that best fits your situation (continued on next page).
Add a Profile for a New Domain Add a Profile for an Existing Domain
1. Select whether the domain you would like to Use this option if you have already set up a
track uses http:// or https:// protocol. If the profile and would like to create another profile
domain uses both protocols, select either that pulls from the same data as the original.
one. Adding a profile to an existing domain allows
you to test changes you would like to make to
2. Add the domain URL of the domain you your original profile without affecting the original
wish to track (excluding the http:// or https://
data, create GA reports with custom
protocol).
segmentation, or track additional goals.
3. Select your country and time zone from the
drop-down menus. Click “Finish”. 1. Select the Domain you would like to apply
the profile to from the drop down menu.
5. Skip the next page by clicking “Finish”. We will be inserting the tracking
code later in the setup process.
Create A Filter
1. To add an “Exclude Internal Traffic” filter, you will need to click on the Edit link under the
profile settings.
2. Scroll down the page until you see the Filters Applied To Profile section and click the
Add Filter link.
3. If you already have a filter that excludes internal traffic, then you can select it by
checking the Apply Existing Filter To Profile radio button and adding the filter to this
profile. If you don’t have an existing filter that excludes internal traffic check the Add
New Filter To Profile radio button and set up the filter as follows:
‣ Filter Name: Name the filter something descriptive so you can easily find it if you
add more filters in the future.
‣ Filter Type: Select “Exclude all traffic from an IP address”
‣ IP Address: Enter your IP address here. Be sure to escape regular expression
characters by starting with a “^”, putting “\” in front of the periods, and ending with
“$” (see example below). This will ensure that you do not accidentally exclude
more traffic than intended. To learn more about regular expressions visit the
resources section of this guide.
3. Enter the URL of the page that will be the final step of your goal. In the example of a
checkout process this may be the “Receipt” or “Thank You“ page.
4. Enter the Name of the Goal. This should be something descriptive so you can easily
differentiate between goals when you have multiple goals set up.
8. *OPTIONAL* Use the Goal Value field to enter in the monetary value of your goal. If
your goal uses dynamic values such as the value of a user’s cart, leave this field blank.
To confirm you have installed the Google Analytics tracking code correctly, try
our our free SiteScan tool at [Link]
The Google Analytics tracking code can be added anywhere within the <head>...</head> or
<body>...</body> tags of your HTML. You can find this by clicking the “Check Status” link under
the “Status” column on the Analytics main page. However, there are several things to consider
before adding the tracking code:
‣ The [Link] file that is called in the Google Analytics tracking code will need to be
loaded from Google’s servers. If there is a delay in the transfer of this file then your
web-page will stop loading until the [Link] file has been fully loaded. To minimize this
affect you can place the code at the bottom of the page. In our experience, there has
been very few load problems with the Google Analytics tracking code.
‣ If you call any other Google Analytics methods on your page such as _trackPageview,
_link, _linkByPost, _addTrans, _addItem, etc., you will need to make sure these are
called after the Google Analytics tracking code.
Below is an example of how the Google Analytics ‘[Link]’ code could be implemented on a basic html page:
<html>
<head></head>
<body>
....
<!--End of Page HTML -->
<script type="text/javascript">
var gaJsHost = (("https:" == [Link]) ? "[Link] : "[Link]
[Link](unescape("%3Cscript src='" + gaJsHost + "[Link]/[Link]' type='text/javascript'%3E%3C/
script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
} catch (err) {} “XXXXXX-X” Should be replaced with your Google Analytics account number
</script>
</body>
</html>
If you know the accounts are linked, or you do not have/want a Google AdWords account you
can skip this step and move on to step six. Without linking your Google Analytics account to a
Google AdWords account you will be limited to 5 million pageviews per month.
Use the same Google account for both your Analytics and AdWords accounts. Make sure the
account is set up as an Administrator in Google Analytics and AdWords.
Linking Accounts:
Auto Tagging
Enabling “Auto Tagging” allows you to automatically track your Google AdWords campaigns in
Google Analytics. While AdWords reporting allows you to see data specific to the performance
of your Google AdWords ad, Google Analytics allows you to monitor a visitor’s interaction with
your site after clicking on your Google AdWords ad.
Enabling “Auto Tagging” also allows the Google Analytics “Keywords Positions” report to be
populated with data.
To enable “Auto-Tagging” log into your Google AdWords account. Select the “My Account” tab,
then select “Account Preferences”. Under the “Account Preferences” column there is the option
to edit your Auto-Tagging status.
The following is an example of how the commerce data should be formated on the final page of
the conversion process:
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-XXXXXX-X");
pageTracker._trackPageview();
pageTracker._addTrans(
"Order ID",
"Affiliation",
"Order Total",
"Order Tax",
"Order Shipping",
"City",
"State/Region",
"Country"
);
pageTracker._addItem(
"Order ID",
"Item SKU/Product Code",
"Item Name",
"Item Category or Variation",
"Item Unit Price",
"Item Quantity"
);
pageTracker._trackTrans();
} catch(err) {}
</script>
*IMPORTANT* The fields, “Order Total”, “Order Shipping”, “Order Tax” and “Item Unit Price”,
must only contain decimal values. NO dollar signs or commas.
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-XXXXXX-X");
pageTracker._trackPageview();
pageTracker._addTrans(
"123abc",
"My Affiliate",
"35.00”,
"7.00",
"10.00",
"AnyTown",
"AnyState",
"USA"
);
pageTracker._addItem(
"123abc",
"def456",
"Awesome T-Shirt",
"Mens Shirts",
"10.00",
"2"
);
pageTracker._addItem(
"123abc",
"ghi789",
"Sweet Sweater",
"Women Sweaters",
"15.00",
"1"
);
pageTracker._trackTrans();
} catch(err) {}
</script>
Important: Please note that a _addItem call must exist for each unique item that the visitor
purchases. If the visitor purchases 3 unique items, all with different SKUs, then an _addItem
must be called three different times.
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-XXXXXX-X");
pageTracker._trackPageview();
pageTracker._addTrans(
"123abc",
"",
"35.00”,
"",
"10.00",
"AnyTown",
"AnyState",
"USA"
);
pageTracker._addItem(
"123abc",
"def456",
"Awesome T-Shirt",
"Mens Shirts",
"10.00",
"2"
);
pageTracker._addItem(
"123abc",
"ghi789",
"Sweet Sweater",
"Women Sweaters",
"15.00",
"1"
);
pageTracker._trackTrans();
} catch(err) {}
</script>
If you want to track your online advertising efforts you can do so by using a method called “link
tagging”. Link tagging allows you to include valuable information about a visitor entering your
site, wether it is from an email, a banner ad, comparison shopping network, or cost per click
campaign.
When you create a link that goes from an outside source to your site, you add on additional
query string variables. When the visitor arrives at your site, these query string variables are
present in the URL. Google Analytics then looks for these variables in the URL, pulls them out,
and puts them into the appropriate reports.
Example: You have a banner ad on someone else's site that links back to your own home page.
The original link for the banner is:
[Link]
This will show up in the reports as a referral from whatever site the banner ad was on. We’ll add
some campaign tracking variables to get more accurate information on the visitor:
[Link]
ad&utm_campaign=2009-fall
Now in the Google Analytics reports you will be able to see that the visitor came from “site-my-
ad-is-on”. The visitor clicked on “banner-ad” and that this “banner-ad” was part of the “2009-fall”
campaign.
Important: Auto-tagging and link tagging append additional query string parameters on to the
end of URLs pointing to your site. In some cases these extra query string parameters may
cause the visitor to be transfered to an error page. Check with your server administrator to make
sure your site allows for these additional query string parameters.
Below is a chart outlining how the five campaign tracking variables are intended for use.
Though it is possible to utilize five variables with every link, there are three required variables
that must be present in a tagged link. Without these variables Google Analytics will not track the
visitor properly.
Google’s URL builder tool can help you create a link quickly and accurately. This is a great tool
to get an understanding of how your links should look, however if you have hundreds of links,
tagging each one in this manor can be a bit laborious.
[Link]
The chart below maps the to campaign tracking variables to the variables primary report and the
cross segmentation value.
The values you use when tagging your links are literally the values that will appear in the reports
under their corresponding Segmentation Values.
‣ Set up goals.
While measuring the basic traffic patterns of your website is important, it is absolutely vital to
measure the processes that you want visitors to engage in. The task could be as simple as
signing up for a newsletter, but you need to know if people are completing the task. If you do not
set up a goal to measure these tasks then you will not know if your website is truly effective.
‣ Do not add the Google Analytics script until all of your profile has been created.
Once you add the [Link] tracking code Google Analytics will start to populate your reports with
data. If your configuration is incorrect, the reports will contain inaccurate data. Take the time to
make sure all the profile settings are correct before you add the tracking code. This way, you
ensure all the data is accurate from the start.
EpikOne Tools:
‣ Exclude Internal Traffic from GA: Create a filter to exclude internal traffic from Google Analytics
reports - [Link]
‣ Regular Expressions Tester: Validate your regular expressions before applying them to your
profile - [Link]
‣ Campaign Tag Newsletter Scanner: Check our e-mail newsletter to ensure it is properly tagged
with campaign parameters - [Link]
‣ Additional Tools: See a full list of the latest Analytics tools from EpikOne -
[Link]