English | Site Directory

Google Analytics Tracking Code

Traffic Sources

Google Analytics tracks traffic to your website from two basic referring sources:

  • organic

    Organic campaigns can come from an unpaid search engine results link, a referral from another website (such as a blog) and direct traffic.

  • paid

    Paid campaigns can come from AdWords, paid search engine keywords, or paid ad campaigns from non-Adwords providers.

Once a user reaches your site from one of these sources, that user's visit is tagged with a campaign tracking cookie as coming from that source. By default, subsequent visits to your site from other sources, such as from a paid search engine link, an Adwords link, or a banner ad, will override the earlier campaign cookie information. In that case, the visit will then appear in your traffic reports as coming from a different source. However, a direct traffic visit that follows a referred visit will never override an existing campaign.

This section covers how to customize the elements that are displayed in the Traffic Sources section of the Google Analytics reporting interface.

  • Campaign tracking
  • Configuring the default search engine list
  • Removing a site as a referrer
  • Redefining keywords as direct traffic

Campaign Tracking

In its broadest definition, campaign tracking refers to a method of identifying how users discovered your site. Specifically, you modify campaign tracking in Google Analytics to accurately track online advertising campaigns to your website, both from AdWords-generated campaigns as well as from other advertising sources. Additionally, you can use some of the campaign tracking customizations to adjust whether subsequent ad referrals override earlier referrals to your site, either organic or paid.

Before configuring campaign tracking using the ga.js campaign tracking settings, you should understand how campaign tracking works in Google Analytics and how you can best use it to track advertising referrals to your site. The following table lists a number of articles in the Help Center that describe campaign tracking. The rest of this section describes campaign tracking settings specific to the ga.js tracking code.

Article Description
Understanding Campaign Tracking A high-level summary of campaign tracking applied to five marketing dimensions.
How Campaign Tracking Works Describes the process of campaign tracking, from setting up and parsing a link, to logging campaign data in the Analytics reporting and associating campaigns with goals in order to track user conversion.
Campaign Tracking URLs Explains which types of URLs from referring sources need to be modified with special variables, or "tagged." Describes the most common types of fields used when constructing a URL.
URL Builder Tool Tool you can use to automatically generate a campaign tracking URL if necessary.
Using Your Own Campaign Tracking Variables Describes how to modify the tracking code to track your own campaign variables for urchin.js tracking. See the information in this section for details on how to use ga.js method calls to use your own campaign tracking variables with this model. This article also contains information about filters you can set if you are manually tagging your AdWords links.

Configuring Campaign Tracking

By default, campaign tracking is enabled with Google Analytics, and will automatically work for your Google AdWords if your Google Analytics account is linked to your Adwords account. In addition, you can use the URL Builder Tool to configure URLs for non-AdWords keyword links, paid or otherwise. The tables below describe the ga.js methods you can use to customize campaign tracking for your site. See the ga.js API Reference for specific implementation examples for these methods.

General Campaign Tracking Features

Feature Description
Disable Campaign Tracking Campaign tracking is enabled by default, but you can use this method to disable campaign tracking and its associated cookies.
Anchors in URLs Set this method to use the # sign as a query string delimiter in your campaign tracking URL.
Set Campaign Timeout By default, campaigns are tracked for 6 months, so that you can determine over a 6-month period if visitors to your site convert based on a specific campaign. However, you can use this method to adjust the tracking life span for your campaigns.
Campaign Overrides By default, the most recent ad impression is the campaign that is credited in your conversion tracking. If you prefer to associate the first-most impressions to a conversion, use this method.

Custom Campaign Tracking Variables

If you have your own campaign tracking variables, use these methods to define your custom variables for the ga.js tracking code. Once you have configured your own variable names, you can use the URL builder tool to easily construct URLs for your ads.

Variable Type Description
Campaign Name This variable is used to define the name of your campaign, which appears in the Analytics reports on the top-level campaign report.
Campaign Source The source variable is typically used to define where the campaign is originating from, such as a website name or a company. For all campaigns, or for a particular campaign, this appears as Source under the Segment pull-down in the Analytics Reports.
Campaign Medium Typically used to define the type of the campaign, such as a banner ad, email campaign, or click ad. For all campaigns, or for a particular campaign, this appears as Keyword under the Segment pull-down in the Analytics Reports.
Campaign Term Defines the keyword terms for that ad. For all campaigns, or for a particular campaign, this appears as Keyword under the Segment pull-down in the Analytics Reports.
Campaign Content Typically used to set the content description for that campaign ad. For all campaigns, or for a particular campaign, this appears as Ad Content under the Segment pull-down in the Analytics Reports.

Search Engine Configuration

By default, Google Analytics identifies the following sites as search engine referrals in your reports. Referrals from search engines not in the list are listed under the Referring Sites report.

Google Netscape Voila Club-internet Google.interia Lycos Mamma Altavista
Yahoo CNN Virgilio Mama Szukacz Ask Alltheweb Gigablast
MSN Looksmart Live Seznam Yam Alice Wp Najdi
AOL About Baidu Search Pchome Yandex Onet Netsprint

You can use the _addOrganic() method to add additional search engines to the list. When you do this, you will also specify the keyword name for that search engine, which is commonly a single character or word (such as q or query) used in the query parameter to demarcate the search string. Call this method for each search engine you want to add to the list. Search engines are added to the list in the order that they are called in your script. You can clear our the entire search engine list by using the _clearOrganic() method, such as if you want to start your search engine list from scratch.

Removing a Site as a Referrer

The Referring Sites report lists all websites that refer to your own site, whether from a search engine result or from a link on another website. In some cases, there might be sites that you administer that you want to exclude from the list of referring sites, such as when you have implemented domain linking for affiliated sites. In those situations, referral reports for affiliated sites are meaningless because user behavior across sites is tracked as if on one site. Traffic from sites that are excluded from the referrer list are counted as direct traffic instead. In the case of cross-domain linking, this referring site from the list, it will be counted as direct traffic. Use the _addIgnoredRef() method to remove a website from the referrer list. You can reset the excluded referrers list with the _clearIgnoredRef() method.

Redefining Keywords as Direct Traffic

When visitors reached your site by entering a search phrase into a search engine, those terms used are listed as keywords in the Keywords report. In some cases you might want to remove certain keywords or phrases from the keywords reports and have them treated as direct traffic. For example, a user can type your domain name example.com as a search phrase, and that phrase is listed as a keyword in the list. You can use the _addIgnoredOrganic() method to treat a keyword as direct traffic, and the _clearIgnoredOrganic() method to clear out your keyword ignore list.

Back to Top