articles

Home / DeveloperSection / Articles / Inroduction of Data Reports in Google Analytics

Inroduction of Data Reports in Google Analytics

Anchal Kesharwani5852 08-Oct-2014

In this article, I’m explaining the concept of data reports in google analytics. 

The Google Analytics is the feature that provide the facility to get the statics of the website. In the google analytics statics get by the help of reports. The report show in the account show very easily but when show the data in the program then it creates problem. So, let’s know about data in google analytics. Reports are generally organize into these categories: users, traffic sources, content, internal site search, goals, and ecommerce. 

Generally, the data report is based on the dimensions and metrics. Analytics reports use a combination of metrics and dimensions to describe key types of user activity to your website, such as which search engine users used to reach your site in the Search Engines report, or which pages on your site received the most traffic in the Top Content report. Similarly, the Core Reporting API groups both dimensions and metrics into several categories of report data. By choosing your own combinations of dimensions and metrics, you can create a customized report tailored to your specifications.

Here we need to define all the data request parameter which is necessary so let’s talk about data request in google analytics: 

Data Feed Request in Google Analytics
 

This section describes all the elements and parameters that make up a data feed request. Let’s understand the data request parameters in google analytics:

·   ids:  The ids is the necessary parameter in the data report in google analytics. This is in provided by <ga:tableId> element for each entry in the account feed. 

·    Dimensions:  The dimension is the optional parameter in the data feeding in the data report of google analytics. For example ga:browser, ga:city, ga:country, and ga:operatingSystem all these dimension that create the category and it contain the descriptive data. The dimension parameter or property has some limits: 

1.       You can supply a maximum of 7 dimensions for any query.

2.       You cannot send a query comprised only of dimensions: you must combine any requested dimension with at least one metric.

3.       Any given dimension can be used with other dimensions or metrics, but only where Valid Combinations apply for that dimension.

·         Metrics: The metrics are the essential part in the data report that is the necessary field to give in the data feed request. The metrics contain the number or percentage. I t also individual part of the dimensions because it divides into groups according to dimensions. The Metrics example is as ga:visits, ga:sessions, ga:users, ga:newUsers, ga:organicSearches,etc. Here some points to keep in the when implement the metrics in the program:

1.       All requests require at least one metric.

2.       You can supply a maximum of 10 metrics for any query.

3.       Not all dimensions and metrics can be used together. Consult the Valid Combinations tool to see which combinations work together. 

  •  Sort: Sort is the property or parameter that contain sort the record according to dimensions or metrics in ascending or descending order. For example if you sort the values according visits in ascending order then “sort=ga:visits” or either descending order then “sort=-ga:visits”. It sort according to sign if it conatin – (minus) sign it sort descending order otherwise it sort ascending order.
  • Filters: Filters is the property that filter the data according to your need. In the google analytics it is most useful property. It is the optional property for data feed request. It filter the data according to dimension and metrics. For example when use the filter “filter=ga:browser==Chrome”. Let’s see the filter rules and properties: 

1.       Filter Syntax: The single filter use this expression

ga:name operator expression

In this syntax name indicate the dimension or metric name and operator use to make condition and expression what result find in the filtering. 

2.   Filter Operators:  The filter operator to use to make the condition in the dimension and metrics. The Filter use different operator metrics and also use the different operator for the dimension.

Metric Filters

There are following operator to filter the metrics data:

  •  Equals operator (==): It returns equal result that result will match.
  •  Does Not Equals operator (! =): It returns result that does not match.
  •  Greater than (>): the greater than operator compare and get the result greater than given value.
  • Less than (<): the less than operator compare and get the result less than given value.
  •  Greater than equal to (>=): the greater than equal to operator compare and get the result greater than given value and if also equal.
  • Less than equal to (<=): the less than equal to operator compare and get the result less than given value and if also equal.
Dimension Filters

There are following operator to filter the metrics data:
  •    Equals operator (==): It returns exact match result that result will match.
  •    Does Not Equals operator (! =): It returns result that does not match.
  •    Contains Substring (=@): It returns that contain the string.
  •    Contains Substring (!@): It returns that does contain the string.
  •    Match regular expression (=~): It returns the result according to regular expression.
  •   Does not Match regular expression It returns the result according to regular expression which not match. 

3.       Filter Expressions: There are a couple of important rules for filter expressions:

  •     URL-reserved characters — Characters such as & must be url-encoded in the usual way.
  •     Reserved characters — The semicolon, comma, and backslash must all be backslash escaped when they appear in an expression.

             1.       semicolon \;

            2.       comma \,

            3.       backslash \\

  •  Regular Expressions: You can also use regular expressions in filter expressions using the =~ and !~ operators. Their syntax is similar to Perl regular expressions and have these additional rules:
  •   Maximum length of 128 characters: Regular expressions longer than 128 characters will result in a 400 Bad Request status code returned from the server.
  •   Case sensitivity: Regular expression matching is case-insensitive.

4.   Combining Filters: This allows you to combine the result that means combine AND, OR operator. This allows you to effectively extend the 128 character limit of a filter expression.

OR

The OR operator is defined using a comma (,). It takes precedence over the AND operator and may NOT be used to combine dimensions and metrics in the same expression.

AND

The AND operator is defined using a semi-colon (;). It is preceded by the OR operator and CAN be used to combine dimensions and metrics in the same expression. 

5.   Segment: The segment is the facility that contain the segment value as dimension and metrics. The segment does not accept all dimension and metric values. For example in the data report send the request with the segment as like this: “Segment =sessions::condition::ga:country==India" this get result from segment that country is India.

6.  start-date: The start date is the required filed for data request in the data report. It indicate beginning date that show the result at this date. The date format is the YYYY-MM-DD.

7.    end-date: The end date is the required filed for data request in the data report. It indicate ending date that show the result till this date. This date format is the YYYY-MM-DD.

8.   start-index: The start index is the optional field that show the result the beginning index that is by default 1.

9.   max-results:  The minimum number of result the by this property.

10.   Prettyprint: Adds the extra whitespace to the feed to make it more readable. This propery is Boolean type that accept true or false. 

Data Feed Response in Google Analytics 

The data feed returns the data by the dimensions and metrics parameters. This section describes the general structure of the data feed as returned in XML, with a description for the key elements of interest for the data feed. There following elements in the data feed:

·         title:  this return the string google analytics for view profile.

·          id: It reruns the feed url.

·         totalResults: this return the total number or results of the query as result.

·         startIndex: the start index show the beginning index that is by default 1.

·         itemsPerPage: the number of items in the current request, which is a maximum of 10,000

·         dxp:startDate: the beginning date of the of the data feed that is the result query.

·         dxp:endDate: the ending date of the of the data feed that is the result query.

·         dxp:containsSampledData:  It indicate the it contains sample data for the data response or not. It returns the Boolean that contain the true or false value.

·         dxp:aggregates: It contains the total values of each metric that contain the query result.

·         dxp:metric: metrics contain all the result that match from the query.

1.       name: the name of the metric

2.       value: the un-paginated value of this metric

3.       type:  the type of metric represent as integer, currency (decimal), or time.

·         dxp:dataSource: summary information about the Analytics source of the data

1.       dxp:tableId: It represents the unique view profile id as ga:12345.

2.       dxp:tableName: It returns the name of the view profile.

3.       dxp:property name=ga:profileId—The view (profile) ID of the source, such as 1174

4.       dxp:property name=ga:webPropertyId—The web property ID of the source, such as UA-50123-1.

5.       dxp:property name=ga:accountName—The name of the account as it appears in the Analytics interface.

·         dxp:segment: For both default and custom advanced segments, the feed returns the name and ID associated with the segment. For dynamic segments, the feed returns the expression contained in the request.

There are following entry attribute in the data feed response:

Entry: Each entry in the response contains the following elements

·         title: the list of dimensions in the query and the matching result for that entry

·         dxp:dimension: one element for each dimension in the query

1.       name: the name of the dimension

2.       value: the value of the dimension

·         dxp:metric: one element for each metric in the query

1.       name: the name of the metric

2.       value: the aggregate value for the query for that metric (e.g. 24 for 24 pageviews)

·         type: the type of the value returned. Can be: currency, float, percent, time, us_currency, an unknown type, or not set.

I hope that this article is useful for you. Thanks!


Updated 31-Mar-2019

Leave Comment

Comments

Liked By