Analytics.js Field Reference

This document lists all of the configurable field names for analytics.js.

  1. Create Only Fields
  2. General
  3. User
  4. Session
  5. Traffic Sources
  6. System Info
  7. Hit
  8. Content Information
  9. Apps
  10. Events
  11. Enhanced E-Commerce
  12. Social Interactions
  13. Timing
  14. Exceptions
  15. Custom Dimensions / Metrics

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
Example value: UA-XXXX-Y
Example 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
Example value: myTracker
Example usage:
ga('create', 'UA-XXXX-Y', {'name': 'myTracker'});

Client ID

Optional. This may only be set in the create method.

Pseudonymously identifies a browser instance. By default, this value is stored as part of the first-party Analytics cookie with a two-year expiration.

Field Name Value Type Default Value
clientId text Randomly Generated
Example value: 35009a79-1a05-49d7-b876-2b884d0f825b
Example 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
Example value: 5
Example 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 beacons will be sent. By default, 1% of users will be automatically be measured.

Field Name Value Type Default Value
siteSpeedSampleRate number 1
Example value: 10
Example 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
Example value: true
Example 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
Example value: false
Example 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
Example value: gaCookie
Example 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 value: example.com
Example usage:
ga('create', 'UA-XXXX-Y', {'cookieDomain': 'example.com'});

Cookie Flags

Optional. This may only be set in the create method.

Specifies additional flags to append to the cookie. Flags must be separated by semicolons.

Field Name Value Type Default Value
cookieFlags text None
Example value: SameSite=None; Secure
Example usage:
ga('create', 'UA-XXXX-Y', {'cookieFlags': 'SameSite=None; Secure'});

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)
Example value: 86400
Example usage:
ga('create', 'UA-XXXX-Y', {'cookieExpires': 86400});

Cookie Update

Optional. This may only be set in the create method.

When cookieUpdate is set to true (the default value), analytics.js will update cookies on each page load. This will update the cookie expiration to be set relative to the most recent visit to the site. For example, if cookie expiration is set to one week, and a user visits using the same browser every five days, the cookie expiration will be updated on each visit and so will effectively never expire.

Field Name Value Type Default Value
cookieUpdate boolean true
Example value: true
Example usage:
ga('create', 'UA-XXXX-Y', {'cookieUpdate': 'false'});

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
Example value: false
Example 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 scripts such as ga.js and urchin.js.

Field Name Value Type Default Value
legacyCookieDomain text None
Example value: store.example.com
Example 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
Example value: false
Example 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
Example value: true
Example 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
Example value: false
Example usage:
ga('set', 'allowAdFeatures', false)

Mask IP

Optional.

When present, the IP address of the sender will be masked.

Field Name Protocol Parameter Value Type Default Value Max Length Supported Hit Types
anonymizeIp aip boolean None N/A all
Example value: true
Example 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
Example value: crm
Example 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
Example value: 560
Example usage:
ga('set', 'queueTime', 560);

Force SSL

Optional.

By default, 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
Example value: true
Example 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
Example value: beacon
Example 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
Example value: true
Example usage:
ga('send', 'event', 'click', 'download-me', {useBeacon: true});

Linker Parameter

Optional.

The linker parameter for cross-domain measurement.

Field Name Protocol Parameter Value Type Default Value Max Length Supported Hit Types
linkerParam None text None None all
Example value: _ga=1.231587807.1974034684.1435105198
Example 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
Example usage:
// 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/library user. It must not itself be PII (personally identifiable information). The value should never be persisted in Google Analytics 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
Example value: as8eknlll
Example 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
Example value: start
Example 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
Example value: http://example.com
Example 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
Example value: (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
Example value: (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
Example value: organic
Example 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
Example value: Blue Shoes
Example 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
Example value: content
Example 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
Example value: ID
Example 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
Example value: 800x600
Example 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
Example value: 123x456
Example 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
Example value: UTF-8
Example 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
Example value: 24-bits
Example 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
Example value: en-us
Example 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
Example value: true
Example 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
Example value: 10 1 r103
Example 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
Example value: pageview
Example 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
Example value: true
Example 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
Example value: http://foo.com/home?a=b
Example 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
Example value: foo.com
Example 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
Example value: /foo
Example 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
Example value: Settings
Example 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
Example value: High Scores
Example 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
Example value: news/sports
Example 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
Example value: nav_bar
Example usage:
ga('set', '&linkid', 'html-element-id');

Apps

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
Example value: My App
Example 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
Example value: com.company.app
Example 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
Example value: 1.2
Example 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
Example value: com.platform.vending
Example usage:
ga('set', 'appInstallerId', 'com.platform.vending');

Events

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
Example value: Category
Example 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
Example value: Action
Example 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
Example value: Label
Example 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
Example value: 55
Example 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
Example value: P12345
Example 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
Example value: Android T-Shirt
Example 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
Example value: Google
Example 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
Example value: Apparel
Example 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
Example value: Black
Example 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
Example value: 29.20
Example 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
Example value: 2
Example 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
Example value: SUMMER_SALE13
Example 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
Example value: 2
Example 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
Example value: Member
Example 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
Example value: 28
Example 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
Example value: detail
Example 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
Example value: T1234
Example 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
Example value: Google Store
Example 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
Example value: 123.21
Example 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
Example value: 10.78
Example 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
Example value: 3.55
Example 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
Example value: SUMMER08
Example 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
Example value: Search Results
Example 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
Example value: 2
Example 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
Example value: Visa
Example 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
Example value: Search Results
Example 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
Example value: P67890
Example 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
Example value: Android T-Shirt
Example 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
Example value: Google
Example 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
Example value: Apparel
Example 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
Example value: Black
Example 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
Example value: 2
Example 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
Example value: 29.20
Example 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
Example value: Member
Example 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
Example value: 28
Example 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
Example value: SHIP
Example 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
Example value: Free Shipping
Example 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
Example value: Shipping Banner
Example 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
Example value: banner_slot_1
Example 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
Example value: click
Example 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
Example value: EUR
Example 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
Example value: facebook
Example 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
Example value: like
Example 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
Example value: http://foo.com
Example 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
Example value: category
Example 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
Example value: lookup
Example 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
Example value: 123
Example 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
Example value: label
Example 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
Example value: DatabaseError
Example 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
Example value: true
Example 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
Example value: Sports
Example 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
Example value: 47
Example usage:
ga('set', 'metric7', 47);