Traffic

Retrieves all Traffic data.

Table Specific Information

Select

Google Analytics only allows up to 10 Metrics and 7 Dimensions in a single query. Therefore, when issuing a query that selects all columns, only the default Metric columns will be selected for tables with more than 10 Metrics. The default Dimensions will be used unless you explicitly select other dimension columns. The following query uses Date instead of the default Source and Medium dimensions:

SELECT Date, Sessions, PercentNewSessions, NewUsers, BounceRate, PageviewsPerSession, AvgSessionDuration, GoalConversionRateAll, Transactions, RevenuePerTransaction, TransactionRevenue FROM Traffic
Filters can also be used in the WHERE clause. Dimension fields support the =, !=, LIKE, and NOT LIKE operators. Metric fields support =, !=, >, >=, <, and <= operators. This query will return the number of Sessions using Google Chrome:
SELECT Browser, Sessions FROM Traffic WHERE Browser LIKE '%Chrome%'
All reports in Google Analytics must cover a specific date range. The default behavior is to pull the last month of data if the StartDate and EndDate inputs are left unset. To override this behavior, the values can be set directly in the query. For example:
SELECT * FROM Traffic WHERE StartDate = '90daysAgo' AND EndDate = 'Today'
The default dimension for the table will be used unless another dimension is specified in the select columns, the DefaultFilter, or the Dimensions column in the WHERE clause. See Retrieving Google Analytics Data for more information about SELECT * queries. The following queries return the same results:
SELECT Source, Medium, Sessions, Users, PercentNewSessions, NewUsers, BounceRate, PageviewsPerSession, AvgSessionDuration, GoalConversionRateAll, Transactions, TransactionRevenue FROM Traffic

Columns

Name TypeDimensionDefaultMetricDefaultDimensionDescription
Date DateTrue The date of the session formatted as YYYYMMDD.
Year IntegerTrue The year of the session. A four-digit year from 2005 to the current year.
Month IntegerTrue The month of the session. An integer from 01 to 12.
Week IntegerTrue The week of the session. A number from 01 to 53. Each week starts on Sunday.
Day IntegerTrue The day of the month. A number from 01 to 31.
Hour IntegerTrue An hour of the day ranging from 00-23 in the timezone configured for the account. This value is also corrected for daylight savings time.
Language StringTrue The language provided by the HTTP Request for the browser. Values are given as an ISO-639 code.
Country StringTrue The country of users, derived from IP addresses.
City StringTrue The cities of property users, derived from IP addresses.
Browser StringTrue The names of browsers used by users to your website. For example, Internet Explorer or Firefox.
OperatingSystem StringTrue The operating system used by your users. For example, Windows, Linux , Macintosh, iPhone, iPod.
DeviceCategory StringTrue The type of device: desktop, tablet, or mobile.
ChannelGrouping StringTrue The channel grouping the data is returned for.
Source StringTrue True The source of referrals to your property
Medium StringTrue True The type of referrals to your property.
UserType StringTrue A boolean indicating if a user is new or returning.
LandingPagePath StringTrue The first page in a user session or landing page.
Campaign StringTrue When using manual campaign tracking, this value is the value of the utm_campaign campaign tracking parameter. When using AdWords autotagging, this value is the name(s) of the online ad campaign that you use for your property. Otherwise, this value is: not set.
SocialNetwork StringTrue Name of the social network. This can be related to the referring social network for traffic sources or to the social network for social data hub activities.
Sessions IntegerFalse True Counts the total number of sessions.
Users IntegerFalse True Total number of users to your property for the requested time period.
PercentNewSessions DoubleFalse True The percentage of sessions by people who had never visited your property before.
NewUsers IntegerFalse True The number of users whose visit to your property was marked as a first-time session.
BounceRate DoubleFalse True The percentage of single-page session.
PageviewsPerSession DoubleFalse True The average number of pages viewed during a session on your property.
AvgSessionDuration DoubleFalse True The average duration of user sessions represented in total seconds.
GoalConversionRateAll DoubleFalse True The percentage of sessions that resulted in a conversion to at least one of your goals.
Transactions IntegerFalse True The total number of transactions.
RevenuePerTransaction DecimalFalse The average revenue for an e-commerce transaction.
TransactionRevenue DecimalFalse True The total sale revenue provided in the transaction, excluding shipping and tax.
TransactionRevenuePerSession DecimalFalse Average transaction revenue for a session on your property.
StartDate StringStart date for fetching Analytics data. Either a date string or a relative date (e.g., today, yesterday, or #daysAgo).
EndDate StringEnd date for fetching Analytics data. Either a date string or a relative date (e.g., today, yesterday, or #daysAgo).
Dimensions StringA comma-separated list of dimensions to retrieve in addition to the columns defined in the schema. Set to empty string to retrieve no dimensions.
Metrics StringA comma-separated list of metrics to retrieve in addition to the columns defined in the schema.
CohortTypes StringAvailable only when using the V4 API. A comma-separated list of cohort types. The default value is FIRST_VISIT_DATE
CohortStartDates DateAvailable only when using the V4 API. A comma-separated list of cohort start dates.
CohortEndDates DateAvailable only when using the V4 API. A comma-separated list of cohort end dates.
SamplesReadCounts StringComma separated list of samples read counts when the response data is sampled.
SamplingSpaceSizes StringComma separated list of samples space sizes counts when the response data is sampled.
Segments StringSegments the data returned for your request. Either a SegmentId or a custom segment.
Profile IntegerProfile ID or website URL to retrieve data from.