How to Correctly Measure Conversion Date & Time in Google Analytics
Table of Contents
There is a predefined dimension in Google Analytics called ‘Hour‘.
This dimension reports hour of the day in the form of two digits ranging from 00 -23.
Here 00 means 12 am, 01 means 1 am, 02 means 2 am…… and 23 means 11 pm.
You can often see this dimension in action in the ‘Adwords hour of the day‘ report:

Through this dimension you can determine when people visited your website, when they interacted with your website and when they converted.
So if you know the hours of the day when people are more likely to convert, you can bid more aggressively during those hours in case of PPC.
For any time sensitive marketing campaign (like newsletter campaigns, TV & Radio campaigns), the ‘hour’ dimension provides valuable insight.
However the problem with ‘hour’ dimension is that it reports the hours in the time zone configured for your Google Analytics account and does not report the hours in the local time zone of your website users:

What that means is that if a user convert on your website at 12 PST (Pacific Standard Time) and the time zone configured for your GA account is BST (British Summer Time) than GA will report that the user converted at 20 BST (or 8 pm BST).
This is because 12 PST = 20 BST as there is 8 hours time difference between PST and BST time zones:
So if you are getting traffic and conversions from multiple time zones (quite common if your market is international or you operate from a country which has got multiple time zones like US, Canada, Russia, China, Australia etc) then you can’t rely on the ‘hour’ dimension for analysis and reporting.
In this article, you will learn to measure and report on the:
#1 Actual hour of the day (which is based on a user’s local time)
#2 User’s local time zone (which Google Analytics does not report by default).
#3 Time of the day like morning, evening, etc which is based on a user’s local time & which GA does not report by default
#4 Current Date and time (including time zone) from users’ system settings

In order to produce this report, we would create a couple of custom dimensions and use the custom data import feature.
Setting up Custom Dimensions
There are 5 stages of creating and using custom dimensions in GA. They are:
#1 Planning – at this stage, you decide the type of data you are going to collect and how you are going to collect the data (i.e. functionality) via custom dimensions.
#2 Configuration – at this stage, custom dimensions are defined via Google Analytics property settings
#3 Collection – at this stage, the values of custom dimensions are sent to Google Analytics from your implementation.
#4 Processing – at this stage the value of custom dimensions are processed according to their configuration values (like scope) and reporting view filters.
#5 Reporting – at this stage the values of custom dimensions become available in the GA reports.
Planning
In order to get ‘Actual hour of the day’, ‘User’s local time zone’, ‘Time of the day’ and ‘Current Date and time’ data, I need to create following 4 custom dimensions with session level scope:
#1 Visit Date and Time – This custom dimension will retrieve current date, time and time zone from date and time settings of a user’s computer .
#2 Visit Hour – This custom dimension retrieves only the hour of the day from date and time settings of a user’s computer.
#3 Time Zone – This custom dimension retrieves only time zone from date and time settings of a user’s computer.
#4 Time of the day – This custom dimension retrieves ‘Time of the day’ which is based on a user’s local time. The ‘Time of the day’ dimension can have following values:
- Morning (5.01 am to 12 pm)
- Afternoon (12.01 pm to 5 pm)
- Evening (5.01 pm to 8 pm)
- Night (8.01 pm to 5 am)
Since time of the day data can not be retrieved from date and time settings of a user’s computer, we will have to import this data into GA via Custom data import and then join this data with actual hour of the day:
In this way GA will be able to compute and report on the ‘time of the day’ dimension.
Configuration
Create following 4 custom dimensions in Google Analytics:
Make sure that you set the dimension scope to ‘Session’ because we are doing all the date and time calculations at the session level.
If you are very new to creating custom dimensions in GA then read this article: https://support.google.com/analytics/answer/2709829?hl=en#set_up_custom_dimensions
Collection
#1 ‘Visit Date and Time’ Custom Dimension
The example code for this dimension would be:
Modify this example code like the one below:
var dimensionValue =new Date();
ga(‘set’, ‘dimension1’, dimensionValue);
Here Date() is a JavaScript object which is used to retrieve current date and time (including time zone) from user’s system settings. We create this object by using the ‘new’ operator. For example:
new Date();
#2 ‘Visit Hour’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension2’, dimensionValue);
Modify this example code like the one below:
var dimensionValue2 = new Date().getHours();
ga(‘set’, ‘dimension2’, dimensionValue2);
Here Date().getHours() retrieves the hour of the day (0 – 23) part from the current date and time settings of a user’s computer.
#3 ‘Time Zone’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension3’, dimensionValue);
Modify this example code like the one below:
function getTimeZone() {
return /\((.*)\)/.exec(new Date().toString())[1];
}
var dimensionValue3 = getTimeZone();
ga(‘set’, ‘dimension3’, dimensionValue3);
Here the function ‘getTimeZone() retrieves the time zone part of the current date and time settings of a user’s computer.
#4 ‘Time of the Day’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension4’, dimensionValue);
But we won’t modify this example code to collect ‘time of the day’ data.
Instead we will import this data directly into GA via custom data import so that it is available to GA during processing stage.
Follow the steps below in order to compute and report the values of ‘time of the day’ dimension in GA:
Step-1: Go the ‘Admin’ section of your view and then click on ‘Data Import’ link under ‘Property’ section:

Step-2: Click on ‘+ New Data Set’ button and then select ‘Custom Data’ as data set type:
Step-3: Click on the ‘Next Step’ button, Enter the name of the new data set and then select the views that will make use of the data in the data set.
Step-4: Click on the ‘Next Step’ button and define your data set schema like the one below:
Step-5: Set ‘Overwrite Hit data’ setting to ‘Yes’ and then click on the ‘Get Schema’ button:
Step-6: Click on the ‘Download schema template’ button and then click on the ‘done’ button twice. The schema template is in the form of a CSV file. Open this file and then add all of the custom data to this file:
Here,
ga:dimension2 => Hour of the day
ga:dimension4 => Time of the day
Step-7: Upload the CSV file you created to Google Analytics by clicking on the ‘manage uploads’ link and then on the ‘Upload file’ button as shown below:

This action will import custom data to your GA property.
Combine the implementation code for the three custom dimensions (‘visit date and time’, ‘visit hour’ and ‘Time Zone’) like the one below:
var dimensionValue =new Date();
ga(‘set’, ‘dimension1’, dimensionValue);
var dimensionValue2 = new Date().getHours();
ga(‘set’, ‘dimension2’, dimensionValue2);
function getTimeZone() {
return /\((.*)\)/.exec(new Date().toString())[1];
}
var dimensionValue3 = getTimeZone();
ga(‘set’, ‘dimension3’, dimensionValue3);
Add these lines of code to your Google Analytics tracking code, immediately above the ‘ga(‘send’, ‘pageview’);’
So your final Google Analytics tracking code will look like the one below:
Processing
At this stage, GA will process the value of custom dimensions according to their configuration values, view filters and the imported custom data. You don’t need to do anything at this stage.
Reporting
At this stage the values of custom dimensions become available in the GA reports.
However to see these values, you would need to create custom reports and select these custom dimensions like the one below:

Another article you will find useful: How to correctly install enhanced ecommerce via Product Data Import
Other articles on specialized tracking in Google Analytics
- Ecommerce Tracking in Google Analytics – Tutorial
- Event Tracking via Google Tag Manager – Tutorial
- Event Tracking in Google Analytics – Tutorial
- Guide to Google Analytics Store Visits Tracking
- Offline Conversion Tracking in Google Analytics – Tutorial
- Implementing E-Commerce Tracking via Google Tag Manager
- Tracking Virtual Pageviews in Google Tag Manager – Tutorial
- YouTube Video tracking via Google Tag Manager
- How to Use Keyword Hero to Reveal Not Provided Keywords in Google Analytics
- Virtual pageviews in Google Analytics – Tutorial
- Google Analytics and YouTube Integration Tutorial
- Google Analytics for Facebook Tutorial
- Google Analytics Cross Domain Tracking Explained Like Never Before
- Using multiple Google Analytics tracking codes on web pages
- The one thing that you don’t know about PayPal.com and the referral exclusion list
- Calculated Metrics in Google Analytics – Tutorial
- Creating your own Google Analytics Tag Auditing System
- Tracking Site Search without Query Parameter in Google Tag Manager
- Tracking true referrals in Google Analytics when using PayPal and other payment gateways
- Phone Call Tracking in Google Analytics and Beyond
- Learn to Track Qualified and Won Leads in Google Analytics
- Introduction to Postbacks in Google Analytics
- Google Analytics Recurring Revenue and Subscriptions Tracking Tutorial
- How to track the impact of cookie consent on website traffic in Google Analytics
- Tracking Offline Conversions in Google Ads
- Implementing Scroll Tracking via Google Tag Manager
- Scroll Tracking via Scroll Depth Trigger in Google Tag Manager
- Site Search Tracking In Google Analytics Without Query Parameters
- Video Tracking via YouTube Video Trigger In Google Tag Manager
- How to Correctly Measure Conversion Date & Time in Google Analytics
- Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
- Google Analytics Cross Domain Tracking (ga.js)
- Tracking Twitter and Linkedin Social Interactions in Google Analytics
- Creating Content Group in Google Analytics via tracking code using gtag.js
- Tracking Site Search in Google Analytics with Query Parameters
- Understanding site search tracking in Google Analytics
- Creating and Using Site Search Funnel in Google Analytics
- Learn to Setup Facebook Pixel Tracking via Google Tag Manager
- Setting up & Tracking AMP Pages in Google Analytics
- Setting up Sales Funnel across websites in Google Analytics
- Regular Expressions (Regex) for Google Analytics & Google Tag Manager – Tutorial
Register for the FREE TRAINING...
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.
Table of Contents
There is a predefined dimension in Google Analytics called ‘Hour‘.
This dimension reports hour of the day in the form of two digits ranging from 00 -23.
Here 00 means 12 am, 01 means 1 am, 02 means 2 am…… and 23 means 11 pm.
You can often see this dimension in action in the ‘Adwords hour of the day‘ report:
Through this dimension you can determine when people visited your website, when they interacted with your website and when they converted.
So if you know the hours of the day when people are more likely to convert, you can bid more aggressively during those hours in case of PPC.
For any time sensitive marketing campaign (like newsletter campaigns, TV & Radio campaigns), the ‘hour’ dimension provides valuable insight.
However the problem with ‘hour’ dimension is that it reports the hours in the time zone configured for your Google Analytics account and does not report the hours in the local time zone of your website users:
What that means is that if a user convert on your website at 12 PST (Pacific Standard Time) and the time zone configured for your GA account is BST (British Summer Time) than GA will report that the user converted at 20 BST (or 8 pm BST).
This is because 12 PST = 20 BST as there is 8 hours time difference between PST and BST time zones:
So if you are getting traffic and conversions from multiple time zones (quite common if your market is international or you operate from a country which has got multiple time zones like US, Canada, Russia, China, Australia etc) then you can’t rely on the ‘hour’ dimension for analysis and reporting.
In this article, you will learn to measure and report on the:
#1 Actual hour of the day (which is based on a user’s local time)
#2 User’s local time zone (which Google Analytics does not report by default).
#3 Time of the day like morning, evening, etc which is based on a user’s local time & which GA does not report by default
#4 Current Date and time (including time zone) from users’ system settings
In order to produce this report, we would create a couple of custom dimensions and use the custom data import feature.
Setting up Custom Dimensions
There are 5 stages of creating and using custom dimensions in GA. They are:
#1 Planning – at this stage, you decide the type of data you are going to collect and how you are going to collect the data (i.e. functionality) via custom dimensions.
#2 Configuration – at this stage, custom dimensions are defined via Google Analytics property settings
#3 Collection – at this stage, the values of custom dimensions are sent to Google Analytics from your implementation.
#4 Processing – at this stage the value of custom dimensions are processed according to their configuration values (like scope) and reporting view filters.
#5 Reporting – at this stage the values of custom dimensions become available in the GA reports.
Planning
In order to get ‘Actual hour of the day’, ‘User’s local time zone’, ‘Time of the day’ and ‘Current Date and time’ data, I need to create following 4 custom dimensions with session level scope:
#1 Visit Date and Time – This custom dimension will retrieve current date, time and time zone from date and time settings of a user’s computer .
#2 Visit Hour – This custom dimension retrieves only the hour of the day from date and time settings of a user’s computer.
#3 Time Zone – This custom dimension retrieves only time zone from date and time settings of a user’s computer.
#4 Time of the day – This custom dimension retrieves ‘Time of the day’ which is based on a user’s local time. The ‘Time of the day’ dimension can have following values:
- Morning (5.01 am to 12 pm)
- Afternoon (12.01 pm to 5 pm)
- Evening (5.01 pm to 8 pm)
- Night (8.01 pm to 5 am)
Since time of the day data can not be retrieved from date and time settings of a user’s computer, we will have to import this data into GA via Custom data import and then join this data with actual hour of the day:
In this way GA will be able to compute and report on the ‘time of the day’ dimension.
Configuration
Create following 4 custom dimensions in Google Analytics:
Make sure that you set the dimension scope to ‘Session’ because we are doing all the date and time calculations at the session level.
If you are very new to creating custom dimensions in GA then read this article: https://support.google.com/analytics/answer/2709829?hl=en#set_up_custom_dimensions
Collection
#1 ‘Visit Date and Time’ Custom Dimension
The example code for this dimension would be:
Modify this example code like the one below:
var dimensionValue =new Date();
ga(‘set’, ‘dimension1’, dimensionValue);
Here Date() is a JavaScript object which is used to retrieve current date and time (including time zone) from user’s system settings. We create this object by using the ‘new’ operator. For example:
new Date();
#2 ‘Visit Hour’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension2’, dimensionValue);
Modify this example code like the one below:
var dimensionValue2 = new Date().getHours();
ga(‘set’, ‘dimension2’, dimensionValue2);
Here Date().getHours() retrieves the hour of the day (0 – 23) part from the current date and time settings of a user’s computer.
#3 ‘Time Zone’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension3’, dimensionValue);
Modify this example code like the one below:
function getTimeZone() {
return /\((.*)\)/.exec(new Date().toString())[1];
}var dimensionValue3 = getTimeZone();
ga(‘set’, ‘dimension3’, dimensionValue3);
Here the function ‘getTimeZone() retrieves the time zone part of the current date and time settings of a user’s computer.
#4 ‘Time of the Day’ Custom Dimension
The example code for this dimension would be:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension4’, dimensionValue);
But we won’t modify this example code to collect ‘time of the day’ data.
Instead we will import this data directly into GA via custom data import so that it is available to GA during processing stage.
Follow the steps below in order to compute and report the values of ‘time of the day’ dimension in GA:
Step-1: Go the ‘Admin’ section of your view and then click on ‘Data Import’ link under ‘Property’ section:
Step-2: Click on ‘+ New Data Set’ button and then select ‘Custom Data’ as data set type:
Step-3: Click on the ‘Next Step’ button, Enter the name of the new data set and then select the views that will make use of the data in the data set.
Step-4: Click on the ‘Next Step’ button and define your data set schema like the one below:
Step-5: Set ‘Overwrite Hit data’ setting to ‘Yes’ and then click on the ‘Get Schema’ button:
Step-6: Click on the ‘Download schema template’ button and then click on the ‘done’ button twice. The schema template is in the form of a CSV file. Open this file and then add all of the custom data to this file:
Here,
ga:dimension2 => Hour of the day
ga:dimension4 => Time of the day
Step-7: Upload the CSV file you created to Google Analytics by clicking on the ‘manage uploads’ link and then on the ‘Upload file’ button as shown below:
This action will import custom data to your GA property.
Combine the implementation code for the three custom dimensions (‘visit date and time’, ‘visit hour’ and ‘Time Zone’) like the one below:
var dimensionValue =new Date();
ga(‘set’, ‘dimension1’, dimensionValue);var dimensionValue2 = new Date().getHours();
ga(‘set’, ‘dimension2’, dimensionValue2);function getTimeZone() {
return /\((.*)\)/.exec(new Date().toString())[1];
}
var dimensionValue3 = getTimeZone();
ga(‘set’, ‘dimension3’, dimensionValue3);
Add these lines of code to your Google Analytics tracking code, immediately above the ‘ga(‘send’, ‘pageview’);’
So your final Google Analytics tracking code will look like the one below:
Processing
At this stage, GA will process the value of custom dimensions according to their configuration values, view filters and the imported custom data. You don’t need to do anything at this stage.
Reporting
At this stage the values of custom dimensions become available in the GA reports.
However to see these values, you would need to create custom reports and select these custom dimensions like the one below:
Another article you will find useful: How to correctly install enhanced ecommerce via Product Data Import
Other articles on specialized tracking in Google Analytics
- Ecommerce Tracking in Google Analytics – Tutorial
- Event Tracking via Google Tag Manager – Tutorial
- Event Tracking in Google Analytics – Tutorial
- Guide to Google Analytics Store Visits Tracking
- Offline Conversion Tracking in Google Analytics – Tutorial
- Implementing E-Commerce Tracking via Google Tag Manager
- Tracking Virtual Pageviews in Google Tag Manager – Tutorial
- YouTube Video tracking via Google Tag Manager
- How to Use Keyword Hero to Reveal Not Provided Keywords in Google Analytics
- Virtual pageviews in Google Analytics – Tutorial
- Google Analytics and YouTube Integration Tutorial
- Google Analytics for Facebook Tutorial
- Google Analytics Cross Domain Tracking Explained Like Never Before
- Using multiple Google Analytics tracking codes on web pages
- The one thing that you don’t know about PayPal.com and the referral exclusion list
- Calculated Metrics in Google Analytics – Tutorial
- Creating your own Google Analytics Tag Auditing System
- Tracking Site Search without Query Parameter in Google Tag Manager
- Tracking true referrals in Google Analytics when using PayPal and other payment gateways
- Phone Call Tracking in Google Analytics and Beyond
- Learn to Track Qualified and Won Leads in Google Analytics
- Introduction to Postbacks in Google Analytics
- Google Analytics Recurring Revenue and Subscriptions Tracking Tutorial
- How to track the impact of cookie consent on website traffic in Google Analytics
- Tracking Offline Conversions in Google Ads
- Implementing Scroll Tracking via Google Tag Manager
- Scroll Tracking via Scroll Depth Trigger in Google Tag Manager
- Site Search Tracking In Google Analytics Without Query Parameters
- Video Tracking via YouTube Video Trigger In Google Tag Manager
- How to Correctly Measure Conversion Date & Time in Google Analytics
- Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
- Google Analytics Cross Domain Tracking (ga.js)
- Tracking Twitter and Linkedin Social Interactions in Google Analytics
- Creating Content Group in Google Analytics via tracking code using gtag.js
- Tracking Site Search in Google Analytics with Query Parameters
- Understanding site search tracking in Google Analytics
- Creating and Using Site Search Funnel in Google Analytics
- Learn to Setup Facebook Pixel Tracking via Google Tag Manager
- Setting up & Tracking AMP Pages in Google Analytics
- Setting up Sales Funnel across websites in Google Analytics
- Regular Expressions (Regex) for Google Analytics & Google Tag Manager – Tutorial
Register for the FREE TRAINING...
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.