This document lists all of the configurable field names for analytics.js.
Create Only Fields
The following fields may only be set in the create method. For more details, read the Creating Tracker Objects section in the Advanced Configuration Guide.
Tracking ID / Web Property ID
Required for all hit types.
The tracking ID / web property ID. The format is UA-XXXX-Y. All collected data is associated by this ID.
| Field Name | Value Type | Default Value |
|---|---|---|
trackingId |
text | None |
UA-XXXX-YExample usage:
ga('create', 'UA-XXXX-Y');
// Alerts the tracking ID for the default tracker.
ga(function(tracker) {
alert(tracker.get('trackingId'));
});
Tracker Name
Optional.
This may only be set in the create method.
Name of the tracker object.
| Field Name | Value Type | Default Value |
|---|---|---|
name |
text | t0 |
myTrackerExample usage:
ga('create', 'UA-XXXX-Y', {'name': 'myTracker'});
Client ID
Optional.
This may only be set in the create method.
Anonymously identifies a browser instance. By default, this value is stored as part of the first-party analytics tracking cookie with a two-year expiration.
| Field Name | Value Type | Default Value |
|---|---|---|
clientId |
text | Randomly Generated |
35009a79-1a05-49d7-b876-2b884d0f825bExample usage:
ga('create', 'UA-XXXX-Y', {
'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b'
});
Sample Rate
Optional.
This may only be set in the create method.
Specifies what percentage of users should be tracked. This defaults to 100 (no users are sampled out) but large sites may need to use a lower sample rate to stay within Google Analytics processing limits.
| Field Name | Value Type | Default Value |
|---|---|---|
sampleRate |
number | 100 |
5Example usage:
ga('create', 'UA-XXXX-Y', {'sampleRate': 5});
Site Speed Sample Rate
Optional.
This may only be set in the create method.
This setting determines how often site speed tracking beacons will be sent. By default, 1% of users will be automatically be tracked.
| Field Name | Value Type | Default Value |
|---|---|---|
siteSpeedSampleRate |
number | 1 |
10Example usage:
ga('create', 'UA-XXXX-Y', {'siteSpeedSampleRate': 10});
Always Send Referrer
Optional.
This may only be set in the create method.
By default the HTTP referrer URL, which is used to attribute traffic sources, is only sent when the hostname of the referring site differs from the hostname of the current page. Enable this setting only if you want to process other pages from your current host as referrals.
| Field Name | Value Type | Default Value |
|---|---|---|
alwaysSendReferrer |
boolean | false |
trueExample usage:
ga('create', 'UA-XXXX-Y', {'alwaysSendReferrer': true});
Allow Anchor Parameters
Optional.
This may only be set in the create method.
By default, analytics.js will search for custom campaign parameters such as utm_source, utm_medium, etc. in both the query string and anchor of the current page's URL. Setting this field to false will result in ignoring any custom campaign parameters that appear in the anchor.
| Field Name | Value Type | Default Value |
|---|---|---|
allowAnchor |
boolean | true |
falseExample usage:
ga('create', 'UA-XXXX-Y', {'allowAnchor': false});
Cookie Name
Optional.
This may only be set in the create method.
Name of the cookie used to store analytics data
| Field Name | Value Type | Default Value |
|---|---|---|
cookieName |
text | _ga |
gaCookieExample usage:
ga('create', 'UA-XXXX-Y', {'cookieName': 'gaCookie'});
Cookie Domain
Optional.
This may only be set in the create method.
Specifies the domain used to store the analytics cookie. Setting this to 'none' sets the cookie without specifying a domain.
| Field Name | Value Type | Default Value |
|---|---|---|
cookieDomain |
text | document.location.hostname (normalized) |
example.comExample usage:
ga('create', 'UA-XXXX-Y', {'cookieDomain': 'example.com'});
Cookie Expiration
Optional.
This may only be set in the create method.
Specifies the cookie expiration, in seconds.
| Field Name | Value Type | Default Value |
|---|---|---|
cookieExpires |
integer | 63072000 (two years) |
86400Example usage:
ga('create', 'UA-XXXX-Y', {'cookieExpires': 86400});
Store GAC
Optional.
This may only be set in the create method.
By default analytics.js writes a cookie to store campaign information. This field can be used to disable writing of that cookie.
| Field Name | Value Type | Default Value |
|---|---|---|
storeGac |
boolean | true |
falseExample usage:
ga('create', 'UA-XXXX-Y', {'storeGac': false});
Legacy Cookie Domain
Optional.
This may only be set in the create method.
This field is used to configure how analytics.js searches for cookies generated by earlier Google Analytics tracking scripts such as ga.js and urchin.js.
| Field Name | Value Type | Default Value |
|---|---|---|
legacyCookieDomain |
text | None |
store.example.comExample usage:
ga('create', 'UA-XXXX-Y', {'legacyCookieDomain': 'store.example.com'});
Legacy History Import
Optional.
This may only be set in the create method.
Specifies whether analytics.js should attempt to import history data from ga.js cookies.
| Field Name | Value Type | Default Value |
|---|---|---|
legacyHistoryImport |
boolean | true |
falseExample usage:
ga('create', 'UA-XXXX-Y', 'auto', {'legacyHistoryImport': false});
Allow Linker Parameters
Optional.
This may only be set in the create method.
Setting this field to true will enables the parsing of cross-domain linker parmeters used to transfer state across domains.
| Field Name | Value Type | Default Value |
|---|---|---|
allowLinker |
boolean | false |
trueExample usage:
ga('create', 'UA-XXXX-Y', {allowLinker: true});
General
Allow Ad Features
Optional.
Set this field to false to disable beacons for the Google Analytics advertising features when
these features have been enabled via the displayfeatures plugin or from within
Google Analytics (Property Settings > Data Collection).
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
allowAdFeatures |
None | boolean | true |
N/A | all |
falseExample usage:
ga('set', 'allowAdFeatures', false);
Anonymize IP
Optional.
When present, the IP address of the sender will be anonymized.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
anonymizeIp |
aip |
boolean | None | N/A | all |
trueExample usage:
ga('set', 'anonymizeIp', true);
Data Source
Optional.
Indicates the data source of the hit. Hits sent from analytics.js will have data source set to 'web'; hits sent from one of the mobile SDKs will have data source set to 'app'.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
dataSource |
ds |
text | None | None | all |
crmExample usage:
ga('set', 'dataSource', 'crm');
Queue Time
Optional.
Used to collect offline / latent hits. The value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The value must be greater than or equal to 0. Values greater than four hours may lead to hits not being processed.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
queueTime |
qt |
integer | None | None | all |
560Example usage:
ga('set', 'queueTime', 560);
Force SSL
Optional.
By default, tracking beacons sent from https pages will be sent using https while beacons sent from http pages will be sent using http. Setting forceSSL to true will force http pages to also send all beacons using https.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
forceSSL |
None | boolean | false |
N/A | all |
trueExample usage:
ga('set', 'forceSSL', true);
Transport
Optional.
This specifies the transport mechanism with which hits will be sent. The options are 'beacon', 'xhr', or 'image'. By default, analytics.js will try to figure out the best method based on the hit size and browser capabilities. If you specify 'beacon' and the user's browser does not support the `navigator.sendBeacon` method, it will fall back to 'image' or 'xhr' depending on hit size.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
transport |
None | text | none (automatically determined) |
None | all |
beaconExample usage:
ga('send', 'event', 'click', 'download-me', {transport: 'beacon'});
Use Beacon
Optional.
This option is now deprecated. Use 'transport' instead. Setting this to true, will instruct the client to use navigator.sendBeacon to send the hit. This is useful in cases where you wish to track an event just before a user navigates away from your site, without delaying the navigation. If the browser does not support navigator.sendBeacon, the hit will be sent normally.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
useBeacon |
None | boolean | false |
N/A | all |
trueExample usage:
ga('send', 'event', 'click', 'download-me', {useBeacon: true});
Linker Parameter
Optional.
The linker parameter for cross-domain tracking.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
linkerParam |
None | text | None | None | all |
_ga=1.231587807.1974034684.1435105198Example usage:
// Alerts the linker parameter for the default tracker.
ga(function(tracker) {
alert(tracker.get('linkerParam'));
});
Hit Callback
Optional.
A function that will be called after processing a hit. This callback is designed to always be called, either directly after a hit is sent successfully or when it has been determined that a hit cannot be sent or has failed to send. No arguments are passed to the function when called. You may want to avoid using hitcallBack to execute code that is critical to your application since it's possible it may not get called in rare cases (e.g. if the server doesn't respond or analytics.js fails to load). In this case, you can set a timeout to ensure execution.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
hitCallback |
None | function | None | None | all |
// Alerts the user when a hit is sent.
ga('send', 'pageview', {
'hitCallback': function() {
alert('hit sent');
}
});
// Use a timeout to ensure the execution of critical application code.
ga('send', 'pageview', {'hitCallback': criticalCode});
setTimeout(criticalCode, 2000);
// Only run the critical code once.
var alreadyCalled = false;
function criticalCode() {
if (alreadyCalled) return;
alreadyCalled = true;
// Run critical code here...
}
User
User ID
Optional.
This field is required if Client ID (cid) is not specified in the request. This is intended to be a known identifier for a user provided by the site owner/tracking library user. It must not itself be PII (personally identifiable information). The value should never be persisted in GA cookies or other Analytics provided storage.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
userId |
uid |
text | None | None | all |
as8eknlllExample usage:
// Set the user ID when creating the tracker.
ga('create', 'UA-XXXX-Y', {'userId': 'as8eknlll'});
// Alternatively, you may set the user ID via the `set` method.
ga('set', 'userId', 'as8eknlll');
Session
Session Control
Optional.
Used to control the session duration. A value of 'start' forces a new session to start with this hit and 'end' forces the current session to end with this hit. All other values are ignored.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
sessionControl |
sc |
text | None | None | all |
startExample usage:
// Starts a new session.
ga('send', 'pageview', {'sessionControl': 'start'});
Traffic Sources
Document Referrer
Optional.
Specifies which referral source brought traffic to a website. This value is also used to compute the traffic source. The format of this value is a URL. This field is initialized by the create command and is only set when the current hostname differs from the referrer hostname, unless the 'alwaysSendReferrer' field is set to true.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
referrer |
dr |
text | document.referrer |
2048 Bytes | all |
http://example.comExample usage:
ga('set', 'referrer', 'http://example.com');
Campaign Name
Optional.
Specifies the campaign name.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignName |
cn |
text | None | 100 Bytes | all |
(direct)Example usage:
ga('set', 'campaignName', '(direct)');
Campaign Source
Optional.
Specifies the campaign source.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignSource |
cs |
text | None | 100 Bytes | all |
(direct)Example usage:
ga('set', 'campaignSource', '(direct)');
Campaign Medium
Optional.
Specifies the campaign medium.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignMedium |
cm |
text | None | 50 Bytes | all |
organicExample usage:
ga('set', 'campaignMedium', 'organic');
Campaign Keyword
Optional.
Specifies the campaign keyword.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignKeyword |
ck |
text | None | 500 Bytes | all |
Blue ShoesExample usage:
ga('set', 'campaignKeyword', 'Blue Shoes');
Campaign Content
Optional.
Specifies the campaign content.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignContent |
cc |
text | None | 500 Bytes | all |
contentExample usage:
ga('set', 'campaignContent', 'content');
Campaign ID
Optional.
Specifies the campaign ID.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
campaignId |
ci |
text | None | 100 Bytes | all |
IDExample usage:
ga('set', 'campaignId', 'ID');
System Info
Screen Resolution
Optional.
Specifies the screen resolution. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
screenResolution |
sr |
text | None | 20 Bytes | all |
800x600Example usage:
ga('set', 'screenResolution', '800x600');
Viewport size
Optional.
Specifies the viewable area of the browser / device. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
viewportSize |
vp |
text | None | 20 Bytes | all |
123x456Example usage:
ga('set', 'viewportSize', '123x456');
Document Encoding
Optional.
Specifies the character set used to encode the page / document. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
encoding |
de |
text | UTF-8 |
20 Bytes | all |
UTF-8Example usage:
ga('set', 'encoding', 'UTF-16');
Screen Colors
Optional.
Specifies the screen color depth. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
screenColors |
sd |
text | None | 20 Bytes | all |
24-bitsExample usage:
ga('set', 'screenColors', '8-bit');
User Language
Optional.
Specifies the language. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
language |
ul |
text | None | 20 Bytes | all |
en-usExample usage:
ga('set', 'language', 'en-us');
Java Enabled
Optional.
Specifies whether Java was enabled. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
javaEnabled |
je |
boolean | None | N/A | all |
trueExample usage:
ga('set', 'javaEnabled', true);
Flash Version
Optional.
Specifies the flash version. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
flashVersion |
fl |
text | None | 20 Bytes | all |
10 1 r103Example usage:
ga('set', 'flashVersion', '10 1 r103');
Hit
Hit type
Required for all hit types.
The type of hit. Must be one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
hitType |
t |
text | None | None | all |
pageviewExample usage:
ga('send', {
'hitType': 'pageview',
'page': '/home'
});
Non-Interaction Hit
Optional.
Specifies that a hit be considered non-interactive.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
nonInteraction |
ni |
boolean | None | N/A | all |
trueExample usage:
ga('set', 'nonInteraction', true);
Content Information
Document location URL
Optional.
Specifies the full URL (excluding anchor) of the page. This field is initialized by the create command.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
location |
dl |
text | None | 2048 Bytes | all |
http://foo.com/home?a=bExample usage:
ga('set', 'location', 'http://foo.com/home?a=b');
Document Host Name
Optional.
Specifies the hostname from which content was hosted.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
hostname |
dh |
text | None | 100 Bytes | all |
foo.comExample usage:
ga('set', 'hostname', 'foo.com');
Document Path
Optional.
The path portion of the page URL. Should begin with '/'. For 'pageview' hits, either &dl or both &dh and &dp have to be specified for the hit to be valid. Used to specify virtual page paths.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
page |
dp |
text | None | 2048 Bytes | all |
/fooExample usage:
ga('set', 'page', '/foo');
Document Title
Optional.
The title of the page / document. Defaults to document.title.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
title |
dt |
text | None | 1500 Bytes | all |
SettingsExample usage:
ga('set', 'title', 'Settings');
Screen Name
Required for screenview hit type.
This parameter is optional on web properties, and required on mobile properties for screenview hits, where it is used for the 'Screen Name' of the screenview hit. On web properties this will default to the unique URL of the page by either using the &dl parameter as-is or assembling it from &dh and &dp.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
screenName |
cd |
text | None | 2048 Bytes | screenview |
High ScoresExample usage:
ga('set', 'screenName', 'High Scores');
Content Group
Optional.
You can have up to 5 content groupings, each of which has an associated index between 1 and 5, inclusive. Each content grouping can have up to 100 content groups. The value of a content group is hierarchical text delimited by '/". All leading and trailing slashes will be removed and any repeated slashes will be reduced to a single slash. For example, '/a//b/' will be converted to 'a/b'.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
contentGroup |
cg<groupIndex> |
text | None | 100 Bytes | all |
news/sportsExample usage:
ga('set', 'contentGroup5', '/news/sports');
Link ID
Optional.
The ID of a clicked DOM element, used to disambiguate multiple links to the same URL in In-Page Analytics reports when Enhanced Link Attribution is enabled for the property.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
linkid |
linkid |
text | None | None | all |
nav_barExample usage:
ga('set', '&linkid', 'html-element-id');
App Tracking
Application Name
Optional.
Specifies the application name. This field is required for any hit that has app related data (i.e., app version, app ID, or app installer ID). For hits sent to web properties, this field is optional.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
appName |
an |
text | None | 100 Bytes | all |
My AppExample usage:
ga('set', 'appName', 'My App');
Application ID
Optional.
Application identifier.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
appId |
aid |
text | None | 150 Bytes | all |
com.company.appExample usage:
ga('set', 'appId', 'com.company.app');
Application Version
Optional.
Specifies the application version.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
appVersion |
av |
text | None | 100 Bytes | all |
1.2Example usage:
ga('set', 'appVersion', '1.2');
Application Installer ID
Optional.
Application installer identifier.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
appInstallerId |
aiid |
text | None | 150 Bytes | all |
com.platform.vendingExample usage:
ga('set', 'appInstallerId', 'com.platform.vending');
Event Tracking
Event Category
Required for event hit type.
Specifies the event category. Must not be empty.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
eventCategory |
ec |
text | None | 150 Bytes | event |
CategoryExample usage:
ga('send', 'event', {
'eventCategory': 'Category',
'eventAction': 'Action'
});
Event Action
Required for event hit type.
Specifies the event action. Must not be empty.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
eventAction |
ea |
text | None | 500 Bytes | event |
ActionExample usage:
ga('send', 'event', {
'eventCategory': 'Category',
'eventAction': 'Action'
});
Event Label
Optional.
Specifies the event label.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
eventLabel |
el |
text | None | 500 Bytes | event |
LabelExample usage:
ga('send', 'event', {
'eventCategory': 'Category',
'eventAction': 'Action',
'eventLabel': 'Label'
});
Event Value
Optional.
Specifies the event value. Values must be non-negative.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
eventValue |
ev |
integer | None | None | event |
55Example usage:
ga('send', 'event', {
'eventCategory': 'Category',
'eventAction': 'Action',
'eventValue': 55
});
Enhanced E-Commerce
Product SKU
Optional.
The SKU of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) id |
pr<productIndex>id |
text | None | 500 Bytes | all |
P12345Example usage:
ga('ec:addProduct', {'id': 'P12345'});
Product Name
Optional.
The name of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) name |
pr<productIndex>nm |
text | None | 500 Bytes | all |
Android T-ShirtExample usage:
ga('ec:addProduct', {'name': 'Android T-Shirt'});
Product Brand
Optional.
The brand associated with the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) brand |
pr<productIndex>br |
text | None | 500 Bytes | all |
GoogleExample usage:
ga('ec:addProduct', {'brand': 'Google'});
Product Category
Optional.
The category to which the product belongs. Product index must be a positive integer between 1 and 200, inclusive. The product category parameter can be hierarchical. Use / as a delimiter to specify up to 5-levels of hierarchy. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) category |
pr<productIndex>ca |
text | None | 500 Bytes | all |
ApparelExample usage:
ga('ec:addProduct', {'category': 'Apparel'});
Product Variant
Optional.
The variant of the product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) variant |
pr<productIndex>va |
text | None | 500 Bytes | all |
BlackExample usage:
ga('ec:addProduct', {'variant': 'Black'});
Product Price
Optional.
The unit price of a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) price |
pr<productIndex>pr |
currency | None | None | all |
29.20Example usage:
ga('ec:addProduct', {'price': '29.20'});
Product Quantity
Optional.
The quantity of a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) quantity |
pr<productIndex>qt |
integer | None | None | all |
2Example usage:
ga('ec:addProduct', {'quantity': 2});
Product Coupon Code
Optional.
The coupon code associated with a product. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) coupon |
pr<productIndex>cc |
text | None | 500 Bytes | all |
SUMMER_SALE13Example usage:
ga('ec:addProduct', {'coupon': 'SUMMER_SALE13'});
Product Position
Optional.
The product's position in a list or collection. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) position |
pr<productIndex>ps |
integer | None | None | all |
2Example usage:
ga('ec:addProduct', {'position': 2});
Product Custom Dimension
Optional.
A product-level custom dimension where dimension index is a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) dimension |
pr<productIndex>cd<dimensionIndex> |
text | None | 150 Bytes | all |
MemberExample usage:
ga('ec:addProduct', {'dimension1': 'Member'});
Product Custom Metric
Optional.
A product-level custom metric where metric index is a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product) metric |
pr<productIndex>cm<metricIndex> |
integer | None | None | all |
28Example usage:
ga('ec:addProduct', {'metric1': 28});
Product Action
Optional.
The role of the products included in a hit. If a product action is not specified, all product definitions included with the hit will be ignored. Must be one of: detail, click, add, remove, checkout, checkout_option, purchase, refund. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) |
pa |
text | None | None | all |
detailExample usage:
ga('ec:setAction', 'detail');
Transaction ID
Optional.
The transaction ID. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) id |
ti |
text | None | None | all |
T1234Example usage:
ga('ec:setAction', 'purchase', {'id': 'T1234'});
Affiliation
Optional.
The store or affiliation from which this transaction occurred. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) affiliation |
ta |
text | None | None | all |
Google StoreExample usage:
ga('ec:setAction', 'purchase', {'affiliation': 'Google Store'});
Revenue
Optional.
The total value of the transaction, including tax and shipping. If not sent, this value will be automatically calculated using the product quantity and price fields of all products in the same hit. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) revenue |
tr |
currency | None | None | all |
123.21Example usage:
ga('ec:setAction', 'purchase', {'revenue': '123.21'});
Tax
Optional.
The total tax associated with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) tax |
tt |
currency | None | None | all |
10.78Example usage:
ga('ec:setAction', 'purchase', {'tax': '10.78'});
Shipping
Optional.
The shipping cost associated with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) shipping |
ts |
currency | None | None | all |
3.55Example usage:
ga('ec:setAction', 'purchase', {'shipping': '3.55'});
Coupon Code
Optional.
The transaction coupon redeemed with the transaction. This is an additional parameter that can be sent when Product Action is set to 'purchase' or 'refund'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) coupon |
tcc |
text | None | None | all |
SUMMER08Example usage:
ga('ec:setAction', 'purchase', {'coupon': 'SUMMER08'});
Product Action List
Optional.
The list or collection from which a product action occurred. This is an additional parameter that can be sent when Product Action is set to 'detail' or 'click'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) list |
pal |
text | None | None | all |
Search ResultsExample usage:
ga('ec:setAction', 'click', {'list': 'Search Results'});
Checkout Step
Optional.
The step number in a checkout funnel. This is an additional parameter that can be sent when Product Action is set to 'checkout'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) step |
cos |
integer | None | None | all |
2Example usage:
ga('ec:setAction', 'checkout', {'step': 2});
Checkout Step Option
Optional.
Additional information about a checkout step. This is an additional parameter that can be sent when Product Action is set to 'checkout'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(product action) option |
col |
text | None | None | all |
VisaExample usage:
ga('ec:setAction', 'checkout', {'option': 'Visa'});
Product Impression List Name
Optional.
The list or collection to which a product belongs. Impression List index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) list |
il<listIndex>nm |
text | None | None | all |
Search ResultsExample usage:
ga('ec:addImpression', {'list': 'Search Results'});
Product Impression SKU
Optional.
The product ID or SKU. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) id |
il<listIndex>pi<productIndex>id |
text | None | None | all |
P67890Example usage:
ga('ec:addImpression', {'id': 'P67890'});
Product Impression Name
Optional.
The name of the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) name |
il<listIndex>pi<productIndex>nm |
text | None | None | all |
Android T-ShirtExample usage:
ga('ec:addImpression', {'name': 'Android T-Shirt'});
Product Impression Brand
Optional.
The brand associated with the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) brand |
il<listIndex>pi<productIndex>br |
text | None | None | all |
GoogleExample usage:
ga('ec:addImpression', {'brand': 'Google'});
Product Impression Category
Optional.
The category to which the product belongs. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) category |
il<listIndex>pi<productIndex>ca |
text | None | None | all |
ApparelExample usage:
ga('ec:addImpression', {'category': 'Apparel'});
Product Impression Variant
Optional.
The variant of the product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) variant |
il<listIndex>pi<productIndex>va |
text | None | None | all |
BlackExample usage:
ga('ec:addImpression', {'variant': 'Black'});
Product Impression Position
Optional.
The product's position in a list or collection. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) position |
il<listIndex>pi<productIndex>ps |
integer | None | None | all |
2Example usage:
ga('ec:addImpression', {'position': 2});
Product Impression Price
Optional.
The price of a product. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) price |
il<listIndex>pi<productIndex>pr |
currency | None | None | all |
29.20Example usage:
ga('ec:addImpression', {'price': '29.20'});
Product Impression Custom Dimension
Optional.
A product-level custom dimension where dimension index is a positive integer between 1 and 200, inclusive. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) dimension |
il<listIndex>pi<productIndex>cd<dimensionIndex> |
text | None | None | all |
MemberExample usage:
ga('ec:addImpression', {'dimension1': 'Member'});
Product Impression Custom Metric
Optional.
A product-level custom metric where metric index is a positive integer between 1 and 200, inclusive. Impression List index must be a positive integer between 1 and 200, inclusive. Product index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(impression) metric |
il<listIndex>pi<productIndex>cm<metricIndex> |
integer | None | None | all |
28Example usage:
ga('ec:addImpression', {'metric1': '28'});
Promotion ID
Optional.
The promotion ID. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(promo) id |
promo<promoIndex>id |
text | None | None | all |
SHIPExample usage:
ga('ec:addPromo', {'id': 'SHIP'});
Promotion Name
Optional.
The name of the promotion. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(promo) name |
promo<promoIndex>nm |
text | None | None | all |
Free ShippingExample usage:
ga('ec:addPromo', {'name': 'Free Shipping'});
Promotion Creative
Optional.
The creative associated with the promotion. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(promo) creative |
promo<promoIndex>cr |
text | None | None | all |
Shipping BannerExample usage:
ga('ec:addPromo', {'creative': 'Shipping Banner'});
Promotion Position
Optional.
The position of the creative. Promotion index must be a positive integer between 1 and 200, inclusive. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(promo) position |
promo<promoIndex>ps |
text | None | None | all |
banner_slot_1Example usage:
ga('ec:addPromo', {'position': 'banner_slot_1'});
Promotion Action
Optional.
Specifies the role of the promotions included in a hit. If a promotion action is not specified, the default promotion action, 'view', is assumed. To measure a user click on a promotion set this to 'promo_click'. For analytics.js the Enhanced Ecommerce plugin must be installed before using this field.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
(promo) action |
promoa |
text | None | None | all |
clickExample usage:
ga('ec:setAction', 'promo_click'});
Currency Code
Optional.
When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
currencyCode |
cu |
text | None | 10 Bytes | all |
EURExample usage:
ga('set', 'currencyCode', 'EUR');
Social Interactions
Social Network
Required for social hit type.
Specifies the social network, for example Facebook or Google Plus.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
socialNetwork |
sn |
text | None | 50 Bytes | social |
facebookExample usage:
ga('send', 'social', {
'socialNetwork': 'facebook',
'socialAction': 'like',
'socialTarget': 'http://foo.com'
})
Social Action
Required for social hit type.
Specifies the social interaction action. For example on Google Plus when a user clicks the +1 button, the social action is 'plus'.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
socialAction |
sa |
text | None | 50 Bytes | social |
likeExample usage:
ga('send', 'social', {
'socialNetwork': 'facebook',
'socialAction': 'like',
'socialTarget': 'http://foo.com'
})
Social Action Target
Required for social hit type.
Specifies the target of a social interaction. This value is typically a URL but can be any text.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
socialTarget |
st |
text | None | 2048 Bytes | social |
http://foo.comExample usage:
ga('send', 'social', {
'socialNetwork': 'facebook',
'socialAction': 'like',
'socialTarget': 'http://foo.com'
})
Timing
User timing category
Required for timing hit type.
Specifies the user timing category.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
timingCategory |
utc |
text | None | 150 Bytes | timing |
categoryExample usage:
ga('send', 'timing', {
'timingCategory': 'category',
'timingVar': 'lookup',
'timingValue': 123
});
User timing variable name
Required for timing hit type.
Specifies the user timing variable.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
timingVar |
utv |
text | None | 500 Bytes | timing |
lookupExample usage:
ga('send', 'timing', {
'timingCategory': 'category',
'timingVar': 'lookup',
'timingValue': 123
});
User timing time
Required for timing hit type.
Specifies the user timing value. The value is in milliseconds.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
timingValue |
utt |
integer | None | None | timing |
123Example usage:
ga('send', 'timing', {
'timingCategory': 'category',
'timingVar': 'lookup',
'timingValue': 123
});
User timing label
Optional.
Specifies the user timing label.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
timingLabel |
utl |
text | None | 500 Bytes | timing |
labelExample usage:
ga('send', 'timing', {
'timingCategory': 'category',
'timingVar': 'lookup',
'timingValue': 123,
'timingLabel': 'label'
});
Exceptions
Exception Description
Optional.
Specifies the description of an exception.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
exDescription |
exd |
text | None | 150 Bytes | exception |
DatabaseErrorExample usage:
ga('send', 'exception', {
'exDescription': 'DatabaseError'
});
Is Exception Fatal?
Optional.
Specifies whether the exception was fatal.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
exFatal |
exf |
boolean | 1 |
N/A | exception |
trueExample usage:
ga('send', 'exception', {
'exFatal': true
});
Custom Dimensions / Metrics
Custom Dimension
Optional.
Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Analytics 360 accounts). The dimension index must be a positive integer between 1 and 200, inclusive.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
dimension |
cd<dimensionIndex> |
text | None | 150 Bytes | all |
SportsExample usage:
ga('set', 'dimension14', 'Sports');
Custom Metric
Optional.
Each custom metric has an associated index. There is a maximum of 20 custom metrics (200 for Analytics 360 accounts). The metric index must be a positive integer between 1 and 200, inclusive.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
metric |
cm<metricIndex> |
number | None | None | all |
47Example usage:
ga('set', 'metric7', 47);
Content Experiments
Experiment ID
Optional.
This parameter specifies that this user has been exposed to an experiment with the given ID. It should be sent in conjunction with the Experiment Variant parameter.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
expId |
xid |
text | None | 40 Bytes | all |
Qp0gahJ3RAO3DJ18b0XoUQExample usage:
ga('set', 'expId', 'Qp0gahJ3RAO3DJ18b0XoUQ');
Experiment Variant
Optional.
This parameter specifies that this user has been exposed to a particular variation of an experiment. It should be sent in conjunction with the Experiment ID parameter.
| Field Name | Protocol Parameter | Value Type | Default Value | Max Length | Supported Hit Types |
|---|---|---|---|---|---|
expVar |
xvar |
text | None | None | all |
1Example usage:
ga('set', 'expVar', '1');