[UA] Campaigns and traffic sources [Legacy]

You are viewing a legacy article about Universal Analytics. Learn more about Google Analytics 4 replacing Universal Analytics.
This article is about campaigns and traffic sources in Universal Analytics. For information about campaigns and traffic sources in Google Analytics 4, go to [GA4] Campaigns and traffic sources.
In this article:

Overview

Users arrive at your website or application through a variety of sources, including advertising campaigns, search engines, and social networks. This article describes how Analytics collects, processes, and reports the campaign and traffic-source data.

If you're experiencing unexpected fluctuations or inconsistencies in your traffic, use this troubleshooter to identify and resolve the issues.

 

Understanding campaigns & traffic sources

In Analytics, the ad campaigns, search engines, social networks, and other sources that send users to your property are collectively known as campaigns and traffic sources. The process by which campaign and traffic-source data is sent to Analytics and populated in reports has the following steps:

Collection, processing, and reporting behavior can be customized.

Collection

The Analytics SDKs and tracking code use these fields when sending campaign and traffic-source data:

Field Name Protocol Parameter Field Description Sample Value
Campaign Source &cs Sets the source dimension in reports. email_promo
Campaign Medium &cm Sets the medium dimension in reports. email
Campaign Name &cn Sets the campaign name dimension in reports. january_boots_promo
Campaign Content &cc Sets the content dimension in reports. email_variation1
Campaign Term &ck Sets the term dimension in reports. winter%20boots
Document Location &dl Sets dimensions when custom campaign (utm) parameters are embedded. http://store.example.com/boots?utm_source=promo_email &utm_medium=email&utm_campaign=january_promo &utm_content=copy_variation1
Document Referrer &dr Describes the referring source and may set dimensions when no other campaign or traffic source fields have been set. http://blog.blogger.com/boots

Note that each session can be attributed to only one campaign or traffic source. Thus, if new campaign or traffic source values are sent to Analytics at collection time in the middle of an existing session, it causes the current session to end and a new session to start.

Processing

During processing, traffic-source and campaign field values are finalized into dimension values and attributed to sessions. The Campaign & Traffic Sources Processing Flowchart illustrates the processing logic.

The following methods apply to processing that uses utm_ parameter values (e.g., display, social, email, paid search, etc.).

  • Source precedence—A direct-traffic visit that follows a referred visit will never override an existing referrer.
  • Campaign precedence—Each visit to your site from a different paid source—such as from a paid search-engine link, a Google Ads link, or a banner ad—overrides the campaign cookie information set by a previous source.
  • One Campaign Per Session—Each visit to your site from a different campaign—organic or paid—triggers a new session, regardless of the actual time elapsed in the current session. Specifically, a change in value for any of the following campaign URL parameters triggers a new session: utm_source, utm_medium, utm_term, utm_content, utm_id, utm_campaign, gclid. For more information on sessions, see How a session is defined in Analytics.

Processing custom campaigns

A session is processed as a custom campaign when custom campaign parameters are embedded in the document location field, or when the campaign-source field is set. When a custom campaign is processed, the values of the custom-campaign parameters map directly to the dimensions in reports.

For example, the following document location field value:

&dl=http://store.example.com/boots
?utm_source=promo_email
&utm_medium=email
&utm_campaign=january_promo
&utm_content=copy_variation1
 

would be processed into the following final dimension values:

source=promo_email
medium=email
campaign=january_promo
content=copy_variation1

Processing paid search-engine referrals

A session is processed as a paid-search referral when custom campaign parameters or Google Ads / Google Marketing Platform click IDs are used in the ad's destination URL and are sent to Analytics in the document location field.

Learn more about how to verify that Google Ads auto-tagging is working.

If custom campaign parameters or click IDs are not used, the session may be processed as organic instead.

Processing organic search-engine referrals

Search-engine referral data is processed by comparing the hostname and query parameter of the document referrer field to a list of known search engines and their query parameters. The first known search engine that matches both the hostname and query parameter of the document referrer value is used to set the report dimension values.

See the list of default search engines.

You can configure the default list with additional custom search engines.

Note that most Google searches are performed via HTTPS, which causes the keyword dimension to automatically be set to (not provided).

Processing social-network referrals

Social-network referral data is processed by comparing the hostname set in the document referrer field to a list of known social networks. The first known social network that contains the hostname string is used to populate the source dimension in reports.

Processing direct traffic

A session is processed as direct traffic when no information about the referral source is available, or when the referring source or search term has been configured to be ignored. Learn about referrer and search term exclusions.

Reporting

After processing, the following campaign and traffic source dimensions and metrics are available in reports:

Dimensions

Web Interface Core Reporting API Description
Source ga:source The source of referrals to your property.
Medium ga:medium The type of referrals to your property (e.g. email, cpc, etc.)
Campaign ga:campaign The name of a marketing campaign sending users to your property
Ad Content ga:adContent A description of the advertising or promotional copy used to send users to your property.
Keyword ga:keyword The keyword searched by users to reach your property.
Social Network ga:socialNetwork Name of the Social Network that referred users to your property.
Referral Path ga:referralPath The path of the referring URL (e.g. the value of the document referrer field)
Social Source Referral ga:hasSocialSourceReferral Indicates whether a session was a referral from a social network. The possible values are Yes and No

Metrics

Web Interface Core Reporting API Description
Organic Searches ga:organicSearches The number of organic searches that happened within a session. This metric is search-engine agnostic.

In the case of paid Google Ads or Google Marketing Platform campaigns, there are additional fields that can be populated automatically by setting either Google Ads or Google Marketing Platformclick IDs, or populated manually by importing cost data.

Advanced configuration options

The following advanced configuration options may be set at the property level:

Campaign Timeout Period

The campaign timeout period determines how long a particular campaign or traffic source is associated with a unique user.

Learn how to configure the campaign timeout period.

Existing campaign or traffic-source data for a particular user will be overwritten by new campaign or traffic-source data, regardless of the configured timeout period. Campaign timeout is counted from the time a specific campaign was first recorded.

Custom Organic Search Sources

Custom organic search sources can be configured at the property level. These custom sources can be added in addition to the default list of search sources. Learn how to customize organic search sources.

Excluding Referrers and Search Terms

Users can exclude certain referring sources or organic search terms from reports by setting these exclusions at the property level.

To prevent "self-referrals" in web measurement, where sessions are attributed to a referral from your own domain, you should add the hostnames you are measuring, as well as the hostnames of any third-party payment gateways, as excluded referrers. Learn how to exclude a referrer and exclude search terms.

Processing flow chart

The following flow chart shows how dimension values are determined based on campaign and traffic-source parameters sent to Analytics in a single hit.

Was this helpful?

How can we improve it?
true
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Search
Clear search
Close search
Google apps
Main menu
1105182373260037266
true
Search Help Center
true
true
true
true
true
69256
true
false