Google Analytics

Measurement Protocol Parameter Reference

This document lists all of the parameters for the Measurement Protocol.

  1. General
  2. User
  3. Session
  4. Traffic Sources
  5. System Info
  6. Hit
  7. Content Information
  8. App Tracking
  9. Event Tracking
  10. E-Commerce
  11. Social Interactions
  12. Timing
  13. Exceptions
  14. Custom Dimensions / Metrics
  15. Content Experiments

General

Protocol Version

Required for all hit types.

The Protocol version. The current value is '1'. This will only change when there are changes made that are not backwards compatible.

Parameter Value Type Default Value Max Length Supported Hit Types
v text None None all
Example value: 1
Example usage: v=1

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.

Parameter Value Type Default Value Max Length Supported Hit Types
tid text None None all
Example value: UA-XXXX-Y
Example usage: tid=UA-XXXX-Y

Anonymize IP

Optional.

When present, the IP address of the sender will be anonymized. For example, the IP will be anonymized if any of the following parameters are present in the payload: &aip=, &aip=0, or &aip=1

Parameter Value Type Default Value Max Length Supported Hit Types
aip boolean None None all
Example value: 1
Example usage: aip=1

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.

Parameter Value Type Default Value Max Length Supported Hit Types
qt integer None None all
Example value: 560
Example usage: qt=560

Cache Buster

Optional.

Used to send a random number in GET requests to ensure browsers and proxies don't cache hits. It should be sent as the final parameter of the request since we've seen some 3rd party internet filtering software add additional parameters to HTTP requests incorrectly. This value is not used in reporting.

Parameter Value Type Default Value Max Length Supported Hit Types
z text None None all
Example value: 289372387623
Example usage: z=289372387623

User

Client ID

Required for all hit types.

This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4) as described in http://www.ietf.org/rfc/rfc4122.txt

Parameter Value Type Default Value Max Length Supported Hit Types
cid text None None all
Example value: 35009a79-1a05-49d7-b876-2b884d0f825b
Example usage: cid=35009a79-1a05-49d7-b876-2b884d0f825b

User ID

Optional.

This is intended to be a known identifier for a user provided by the site owner/tracking library user. It may not itself be PII. The value should never be persisted in GA cookies or other Analytics provided storage.

Parameter Value Type Default Value Max Length Supported Hit Types
uid text None None all
Example value: as8eknlll
Example usage: uid=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.

Parameter Value Type Default Value Max Length Supported Hit Types
sc text None None all
Example value: start
Example usage: sc=start

Example value: end
Example usage: sc=end

IP Override

Optional.

The IP address of the user. This should be a valid IP address. It will always be anonymized just as though &aip (anonymize IP) had been used.

Parameter Value Type Default Value Max Length Supported Hit Types
uip text None None all
Example value: 1.2.3.4
Example usage: uip=1.2.3.4

User Agent Override

Optional.

The User Agent of the browser. Note that Google has libraries to identify real user agents. Hand crafting your own agent could break at any time.

Parameter Value Type Default Value Max Length Supported Hit Types
ua text None None all
Example value: Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14
Example usage: ua=Opera%2F9.80%20%28Windows%20NT%206.0%29%20Presto%2F2.12.388%20Version%2F12.14

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.

Parameter Value Type Default Value Max Length Supported Hit Types
dr text None 2048 Bytes all
Example value: http://example.com
Example usage: dr=http%3A%2F%2Fexample.com

Campaign Name

Optional.

Specifies the campaign name.

Parameter Value Type Default Value Max Length Supported Hit Types
cn text None 100 Bytes all
Example value: (direct)
Example usage: cn=%28direct%29

Campaign Source

Optional.

Specifies the campaign source.

Parameter Value Type Default Value Max Length Supported Hit Types
cs text None 100 Bytes all
Example value: (direct)
Example usage: cs=%28direct%29

Campaign Medium

Optional.

Specifies the campaign medium.

Parameter Value Type Default Value Max Length Supported Hit Types
cm text None 50 Bytes all
Example value: organic
Example usage: cm=organic

Campaign Keyword

Optional.

Specifies the campaign keyword.

Parameter Value Type Default Value Max Length Supported Hit Types
ck text None 500 Bytes all
Example value: Blue Shoes
Example usage: ck=Blue%20Shoes

Campaign Content

Optional.

Specifies the campaign content.

Parameter Value Type Default Value Max Length Supported Hit Types
cc text None 500 Bytes all
Example value: content
Example usage: cc=content

Campaign ID

Optional.

Specifies the campaign ID.

Parameter Value Type Default Value Max Length Supported Hit Types
ci text None 100 Bytes all
Example value: ID
Example usage: ci=ID

Google AdWords ID

Optional.

Specifies the Google AdWords Id.

Parameter Value Type Default Value Max Length Supported Hit Types
gclid text None None all
Example value: CL6Q-OXyqKUCFcgK2goddQuoHg
Example usage: gclid=CL6Q-OXyqKUCFcgK2goddQuoHg

Google Display Ads ID

Optional.

Specifies the Google Display Ads Id.

Parameter Value Type Default Value Max Length Supported Hit Types
dclid text None None all
Example value: d_click_id
Example usage: dclid=d_click_id

System Info

Screen Resolution

Optional.

Specifies the screen resolution.

Parameter Value Type Default Value Max Length Supported Hit Types
sr text None 20 Bytes all
Example value: 800x600
Example usage: sr=800x600

Viewport size

Optional.

Specifies the viewable area of the browser / device.

Parameter Value Type Default Value Max Length Supported Hit Types
vp text None 20 Bytes all
Example value: 123x456
Example usage: vp=123x456

Document Encoding

Optional.

Specifies the character set used to encode the page / document.

Parameter Value Type Default Value Max Length Supported Hit Types
de text UTF-8 20 Bytes all
Example value: UTF-8
Example usage: de=UTF-8

Screen Colors

Optional.

Specifies the screen color depth.

Parameter Value Type Default Value Max Length Supported Hit Types
sd text None 20 Bytes all
Example value: 24-bits
Example usage: sd=24-bits

User Language

Optional.

Specifies the language.

Parameter Value Type Default Value Max Length Supported Hit Types
ul text None 20 Bytes all
Example value: en-us
Example usage: ul=en-us

Java Enabled

Optional.

Specifies whether Java was enabled.

Parameter Value Type Default Value Max Length Supported Hit Types
je boolean None None all
Example value: 1
Example usage: je=1

Flash Version

Optional.

Specifies the flash version.

Parameter Value Type Default Value Max Length Supported Hit Types
fl text None 20 Bytes all
Example value: 10 1 r103
Example usage: fl=10%201%20r103

Hit

Hit type

Required for all hit types.

The type of hit. Must be one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'.

Parameter Value Type Default Value Max Length Supported Hit Types
t text None None all
Example value: pageview
Example usage: t=pageview

Non-Interaction Hit

Optional.

Specifies that a hit be considered non-interactive.

Parameter Value Type Default Value Max Length Supported Hit Types
ni boolean None None all
Example value: 1
Example usage: ni=1

Content Information

Document location URL

Optional.

Use this parameter to send the full URL (document location) of the page on which content resides. You can use the &dh and &dp parameters to override the hostname and path + query portions of the document location, accordingly. The JavaScript clients determine this parameter using the concatenation of the document.location.origin + document.location.pathname + document.location.search browser parameters. Be sure to remove any user authentication or other private information from the URL if present.

Parameter Value Type Default Value Max Length Supported Hit Types
dl text None 2048 Bytes all
Example value: http://foo.com/home?a=b
Example usage: dl=http%3A%2F%2Ffoo.com%2Fhome%3Fa%3Db

Document Host Name

Optional.

Specifies the hostname from which content was hosted.

Parameter Value Type Default Value Max Length Supported Hit Types
dh text None 100 Bytes all
Example value: foo.com
Example usage: dh=foo.com

Document Path

Optional.

The path portion of the page URL. Should begin with '/'.

Parameter Value Type Default Value Max Length Supported Hit Types
dp text None 2048 Bytes all
Example value: /foo
Example usage: dp=%2Ffoo

Document Title

Optional.

The title of the page / document.

Parameter Value Type Default Value Max Length Supported Hit Types
dt text None 1500 Bytes all
Example value: Settings
Example usage: dt=Settings

Screen Name

Optional.

If not specified, 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. App tracking makes use of this for the 'Screen Name' of the screenview hit.

Parameter Value Type Default Value Max Length Supported Hit Types
cd text None 2048 Bytes all
Example value: High Scores
Example usage: cd=High%20Scores

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.

Parameter Value Type Default Value Max Length Supported Hit Types
linkid text None None all
Example value: nav_bar
Example usage: linkid=nav_bar

App Tracking

Application Name

Optional.

Specifies the application name.

Parameter Value Type Default Value Max Length Supported Hit Types
an text None 100 Bytes all
Example value: My App
Example usage: an=My%20App

Application ID

Optional.

Application identifier.

Parameter Value Type Default Value Max Length Supported Hit Types
aid text None 150 Bytes all
Example value: com.company.app
Example usage: aid=com.company.app

Application Version

Optional.

Specifies the application version.

Parameter Value Type Default Value Max Length Supported Hit Types
av text None 100 Bytes all
Example value: 1.2
Example usage: av=1.2

Application Installer ID

Optional.

Application installer identifier.

Parameter Value Type Default Value Max Length Supported Hit Types
aiid text None 150 Bytes all
Example value: com.platform.vending
Example usage: aiid=com.platform.vending

Event Tracking

Event Category

Optional.

Specifies the event category. Must not be empty.

Parameter Value Type Default Value Max Length Supported Hit Types
ec text None 150 Bytes event
Example value: Category
Example usage: ec=Category

Event Action

Optional.

Specifies the event action. Must not be empty.

Parameter Value Type Default Value Max Length Supported Hit Types
ea text None 500 Bytes event
Example value: Action
Example usage: ea=Action

Event Label

Optional.

Specifies the event label.

Parameter Value Type Default Value Max Length Supported Hit Types
el text None 500 Bytes event
Example value: Label
Example usage: el=Label

Event Value

Optional.

Specifies the event value. Values must be non-negative.

Parameter Value Type Default Value Max Length Supported Hit Types
ev integer None None event
Example value: 55
Example usage: ev=55

E-Commerce

Transaction ID

Required for transaction hit type.
Required for item hit type.

A unique identifier for the transaction. This value should be the same for both the Transaction hit and Items hits associated to the particular transaction.

Parameter Value Type Default Value Max Length Supported Hit Types
ti text None 500 Bytes transaction, item
Example value: OD564
Example usage: ti=OD564

Transaction Affiliation

Optional.

Specifies the affiliation or store name.

Parameter Value Type Default Value Max Length Supported Hit Types
ta text None 500 Bytes transaction
Example value: Member
Example usage: ta=Member

Transaction Revenue

Optional.

Specifies the total revenue associated with the transaction. This value should include any shipping or tax costs.

Parameter Value Type Default Value Max Length Supported Hit Types
tr currency 0 None transaction
Example value: 15.47
Example usage: tr=15.47

Transaction Shipping

Optional.

Specifies the total shipping cost of the transaction.

Parameter Value Type Default Value Max Length Supported Hit Types
ts currency 0 None transaction
Example value: 3.50
Example usage: ts=3.50

Transaction Tax

Optional.

Specifies the total tax of the transaction.

Parameter Value Type Default Value Max Length Supported Hit Types
tt currency 0 None transaction
Example value: 11.20
Example usage: tt=11.20

Item Name

Required for item hit type.

Specifies the item name.

Parameter Value Type Default Value Max Length Supported Hit Types
in text None 500 Bytes item
Example value: Shoe
Example usage: in=Shoe

Item Price

Optional.

Specifies the price for a single item / unit.

Parameter Value Type Default Value Max Length Supported Hit Types
ip currency 0 None item
Example value: 3.50
Example usage: ip=3.50

Item Quantity

Optional.

Specifies the number of items purchased.

Parameter Value Type Default Value Max Length Supported Hit Types
iq integer 0 None item
Example value: 4
Example usage: iq=4

Item Code

Optional.

Specifies the SKU or item code.

Parameter Value Type Default Value Max Length Supported Hit Types
ic text None 500 Bytes item
Example value: SKU47
Example usage: ic=SKU47

Item Category

Optional.

Specifies the category that the item belongs to.

Parameter Value Type Default Value Max Length Supported Hit Types
iv text None 500 Bytes item
Example value: Blue
Example usage: iv=Blue

Currency Code

Optional.

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

Parameter Value Type Default Value Max Length Supported Hit Types
cu text None 10 Bytes transaction, item
Example value: EUR
Example usage: cu=EUR

Social Interactions

Social Network

Required for social hit type.

Specifies the social network, for example Facebook or Google Plus.

Parameter Value Type Default Value Max Length Supported Hit Types
sn text None 50 Bytes social
Example value: facebook
Example usage: sn=facebook

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'.

Parameter Value Type Default Value Max Length Supported Hit Types
sa text None 50 Bytes social
Example value: like
Example usage: sa=like

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.

Parameter Value Type Default Value Max Length Supported Hit Types
st text None 2048 Bytes social
Example value: http://foo.com
Example usage: st=http%3A%2F%2Ffoo.com

Timing

User timing category

Optional.

Specifies the user timing category.

Parameter Value Type Default Value Max Length Supported Hit Types
utc text None 150 Bytes timing
Example value: category
Example usage: utc=category

User timing variable name

Optional.

Specifies the user timing variable.

Parameter Value Type Default Value Max Length Supported Hit Types
utv text None 500 Bytes timing
Example value: lookup
Example usage: utv=lookup

User timing time

Optional.

Specifies the user timing value. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
utt integer None None timing
Example value: 123
Example usage: utt=123

User timing label

Optional.

Specifies the user timing label.

Parameter Value Type Default Value Max Length Supported Hit Types
utl text None 500 Bytes timing
Example value: label
Example usage: utl=label

Page Load Time

Optional.

Specifies the time it took for a page to load. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
plt integer None None timing
Example value: 3554
Example usage: plt=3554

DNS Time

Optional.

Specifies the time it took to do a DNS lookup.The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
dns integer None None timing
Example value: 43
Example usage: dns=43

Page Download Time

Optional.

Specifies the time it took for the page to be downloaded. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
pdt integer None None timing
Example value: 500
Example usage: pdt=500

Redirect Response Time

Optional.

Specifies the time it took for any redirects to happen. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
rrt integer None None timing
Example value: 500
Example usage: rrt=500

TCP Connect Time

Optional.

Specifies the time it took for a TCP connection to be made. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
tcp integer None None timing
Example value: 500
Example usage: tcp=500

Server Response Time

Optional.

Specifies the time it took for the server to respond after the connect time. The value is in milliseconds.

Parameter Value Type Default Value Max Length Supported Hit Types
srt integer None None timing
Example value: 500
Example usage: srt=500

Exceptions

Exception Description

Optional.

Specifies the description of an exception.

Parameter Value Type Default Value Max Length Supported Hit Types
exd text None 150 Bytes exception
Example value: DatabaseError
Example usage: exd=DatabaseError

Is Exception Fatal?

Optional.

Specifies whether the exception was fatal.

Parameter Value Type Default Value Max Length Supported Hit Types
exf boolean 1 None exception
Example value: 0
Example usage: exf=0

Custom Dimensions / Metrics

Custom Dimension

Optional.

Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.

Parameter Value Type Default Value Max Length Supported Hit Types
cd[1-9][0-9]* text None 150 Bytes all
Example value: Sports
Example usage: cd[1-9][0-9]*=Sports

Custom Metric

Optional.

Each custom metric has an associated index. There is a maximum of 20 custom metrics (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.

Parameter Value Type Default Value Max Length Supported Hit Types
cm[1-9][0-9]* integer None None all
Example value: 47
Example usage: cm[1-9][0-9]*=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.

Parameter Value Type Default Value Max Length Supported Hit Types
xid text None 40 Bytes all
Example value: Qp0gahJ3RAO3DJ18b0XoUQ
Example usage: xid=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.

Parameter Value Type Default Value Max Length Supported Hit Types
xvar text None None all
Example value: 1
Example usage: xvar=1

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.