Describes how to calculate common metrics using data feeds.
Bots are excluded from data feeds according to the bot rules defined for your report suite.
Include rows from the date range you want included by filtering the date_time field. The date_time field is human readable (for example, YYYY-MM-DD HH:MM:SS ) and is adjusted to the time zone of the report suite. For example, date_time starts with "2013-12" includes hits from December 2013.
The event string in event_list and post_event_list contains a comma-delimited list of events, which may have a value and/or a unique ID. We recommend doing all processing on the post_event_list because it is de-duplicated and has already applied logic to remove duplicate events with the same ID (see Event Serialization ).
For event ID to name mapping, see the event lookup delivered with your data feed.
For more information on events, see Events .
Formulas for common metrics
The following table contains instructions to calculate several common metrics.
|Metric||How to calculate|
Page views can be calculated by counting when there is either a value in post_pagename or post_page_url .
You can use similar logic to count custom links:
*In rare circumstances, internet irregularities, system irregularities, or the use of custom visitor IDs can result in duplicate visit_num values for the same visitor ID that are not the same visit . To avoid resulting issues, also include visit_start_time_gmt when counting visits.
When an event is set on a hit, post_event_list contains the event. The post_event_list is de-duplicated and is recommended to determine event instances.
For example:post_event_list = 1,200
Indicates an instance of purchase and event1 .
When an eVar is set on a hit, event_list contains an instance of that eVar.
For example:post_event_list = 100,101,106
Indicates an instance of eVar1 , eVar2 , and eVar7 . This means that a value for these three eVars was set on the hit.
To calculate instances for eVars, use the same logic explained in Event instances above, but count the number of times the eVar lookup appears in the post_event_list .
To calculate time spent, you must group hits by visit, then order them according to the hit number within the visit.
This logic can be extended to calculate time spent for other values. When calculating time spent, Analytics calculates time spent based on the time the value was set in a track ( page_event=0 ) or trackLink ( page_event=10|11|12 ) call, to the time of the next page view ( track call).
When reporting time spent for a specific period, marketing reports & analytics and ad hoc analysis evaluate hits beyond the reporting period to determine time spent for values within the reporting period, except when the start and/or end date of the time period is on a monthly boundary. Due to the complexity of these calculations, it might be difficult to match the time spent metrics exactly. Data warehouse does not evaluate hits beyond the reporting period.
|Revenue, orders, units|
Currency conversion is applied to the post_product_list according to the settings for the report suite, so using that column is recommended.
Note: Analytics allows currency events that contain product revenue to be passed in through the events string, so you might need to account for revenue that is not in the products string. See Numeric/Currency Events in s.events .