Adding a Time Zone Filter in Google Data Studio

Heatmaps are a great way to visualize the time and day of the week for conversions on your website. It can help you plan out social posts, optimize bids on Google Ads, and schedule your email marketing campaigns.

However, for many companies that serve customers nationwide, the standard heatmap report in Google Data Studio could lead you to draw incorrect conclusions on when those conversions occur. Luckily, by adding a time zone filter to your reports, you can still gain accurate conversion insights to help you better understand your users.

How Time Is Reported in Google Analytics

Time reported in Google Analytics is based on the time zone you select in your property and view settings. That means that if your time zone in Google Analytics is set to Central Standard Time (CST) and a user converts in Seattle at 7:00 p.m. Pacific Time, your Google Analytics account will show a conversion at 9:00 p.m.

This large discrepancy between the time on the East Coast and the time on the West Coast is the reason why aggregating the hour of day metric within your reporting can lead to inaccurate assumptions about your target audience.

How To Set Up A Time Zone Filter in Google Data Studio

In order to set up time zones in Google Data Studio, you’ll need to set up a custom dimension within your Google Analytics data source. Once you’ve added the data source to your report, go to Resource > Manage Added Data Sources

Click “Edit” once your data source appears.

Then click “Add A Field”

Name your Field Name – I chose the name “Time Zone.” Then you’ll use a Case/When formula to categorize each metro in Google Analytics into a specific time zone.

To make it easy, you can copy and paste the code below:

CASE 
 WHEN REGEXP_MATCH(Metro, '.*(Anchorage AK|Fairbanks AK|Juneau AK).*') THEN 'Alaska Standard Time'
 WHEN REGEXP_MATCH(Metro, '.*(Dothan AL|Birmingham (.*) AL|Huntsville-Decatur (.*) AL|Montgomery-Selma, AL|Little Rock-Pine Bluff AR|Monroe LA-El Dorado AR|Ft. Smith-Fayetteville-Springdale-Rogers AR|Jonesboro AR|Panama City FL|Des Moines-Ames IA|Cedar Rapids-Waterloo-Iowa City & Dubuque IA|Sioux City IA|Rochester-Mason City-Austin,IA|Quincy IL-Hannibal MO-Keokuk IA|Chicago IL|Champaign & Springfield-Decatur IL|Peoria-Bloomington IL|Paducah KY-Cape Girardeau MO-Harrisburg-Mount Vernon IL|Davenport IA-Rock Island-Moline IL|Rockford IL|Shreveport LA|New Orleans LA|Lake Charles LA|Baton Rouge LA|Lafayette LA|Alexandria LA|Minneapolis-St. Paul MN|Mankato MN|St. Louis MO|Kansas City MO|Columbia-Jefferson City MO|Springfield MO|Ottumwa IA-Kirksville MO|St. Joseph MO|Jackson MS|Biloxi-Gulfport MS|Hattiesburg-Laurel MS|Columbus-Tupelo-West Point MS|Meridian MS|Greenwood-Greenville MS|Fargo-Valley City ND|Omaha NE|Lincoln & Hastings-Kearney NE|North Platte NE|Oklahoma City OK|Tulsa OK|Sherman-Ada, OK|Wichita Falls TX & Lawton OK|Memphis TN|Nashville TN|Houston TX|Dallas-Ft. Worth TX|Tyler-Longview(.*) TX|Austin TX|San Antonio TX|Harlingen-Weslaco-Brownsville-McAllen TX|Waco-Temple-Bryan TX|Lubbock TX|Corpus Christi TX|Laredo TX|Beaumont-Port Arthur TX|Amarillo TX|Abilene-Sweetwater TX|San Angelo TX|Victoria TX|Odessa-Midland TX|Milwaukee WI|Green Bay-Appleton WI|Madison WI|La Crosse-Eau Claire WI|Wausau-Rhinelander WI|Duluth MN-Superior WI|Joplin MO-Pittsburg KS|Topeka KS|Evansville IN|Wichita-Hutchinson KS|Minot-Bismarck-Dickinson(.*) ND|Jackson TN|Mobile AL-Pensacola (.*) FL|Bowling Green KY|Sioux Falls(.*) SD).*') THEN 'Central Standard Time'
 WHEN REGEXP_MATCH(Metro, '.*(Washington DC (.*)|Hartford & New Haven CT|Miami-Ft. Lauderdale FL|Tampa-St. Petersburg (.*) FL|Orlando-Daytona Beach-Melbourne FL|West Palm Beach-Ft. Pierce FL|Jacksonville FL|Ft. Myers-Naples FL|Gainesville FL|Atlanta GA|Macon GA|Savannah GA|Augusta GA|Columbus GA|Tallahassee FL-Thomasville GA|Albany GA|Indianapolis IN|South Bend-Elkhart IN|Louisville KY|Lexington KY|Providence-New Bedford,MA|Springfield-Holyoke MA|Baltimore MD|Salisbury MD|Portland-Auburn ME|Bangor ME|Presque Isle ME|Detroit MI|Lansing MI|Grand Rapids-Kalamazoo-Battle Creek MI|Charlotte NC|Greenville-New Bern-Washington NC|Raleigh-Durham (.*) NC|Greenville-Spartanburg-Asheville-Anderson|Greensboro-High Point-Winston Salem NC|Wilmington NC|Boston MA-Manchester NH|New York NY|Utica NY|Rochester NY|Albany-Schenectady-Troy NY|Buffalo NY|Syracuse NY|Burlington VT-Plattsburgh NY|Binghamton NY|Elmira (.*) NY|Watertown NY|Cleveland-Akron (.*) OH|Dayton OH|Cincinnati OH|Columbus OH|Toledo OH|Youngstown OH|Zanesville OH|Wheeling WV-Steubenville OH|Lima OH|Philadelphia PA|Harrisburg-Lancaster-Lebanon-York PA|Johnstown-Altoona-State College PA|Wilkes Barre-Scranton PA|Pittsburgh PA|Erie PA|Charleston SC|Florence-Myrtle Beach SC|Columbia SC|Knoxville TN|Richmond-Petersburg VA|Norfolk-Portsmouth-Newport News VA|Roanoke-Lynchburg VA|Charlottesville VA|Tri-Cities TN-VA|Harrisonburg VA|Charleston-Huntington WV|Clarksburg-Weston WV|Bluefield-Beckley-Oak Hill WV|Parkersburg WV|Ft. Wayne IN|Terre Haute IN|Marquette MI|Alpena MI|Chattanooga TN|Lafayette IN|Flint-Saginaw-Bay City MI|Traverse City-Cadillac MI).*') THEN 'Eastern Standard Time'
 WHEN REGEXP_MATCH(Metro, '.*(Honolulu HI).*') THEN 'Hawaii Standard Time'
 WHEN REGEXP_MATCH(Metro, '.*(Phoenix AZ|Denver CO|Grand Junction-Montrose CO|Colorado Springs-Pueblo CO|Boise ID|Missoula MT|Helena MT|Butte-Bozeman MT|Billings, MT|Great Falls MT|Glendive MT|Cheyenne WY-Scottsbluff NE|Albuquerque-Santa Fe NM|Rapid City SD|El Paso TX|Salt Lake City UT|Casper-Riverton WY|Tucson (.*) AZ|Idaho Falls-Pocatello ID|Twin Falls ID).*') THEN 'Mountain Standard Time'
 WHEN REGEXP_MATCH(Metro, '.*(Los Angeles CA|San Francisco-Oakland-San Jose CA|San Diego CA|Monterey-Salinas CA|Santa Barbara-Santa Maria-San Luis Obispo CA|Sacramento-Stockton-Modesto CA|Chico-Redding CA|Palm Springs CA|Fresno-Visalia CA|Yuma AZ-El Centro CA|Bakersfield CA|Eureka CA|Portland OR|Seattle-Tacoma WA|Spokane WA|Yakima-Pasco-Richland-Kennewick WA|Reno NV|Las Vegas NV|Eugene OR|Medford-Klamath Falls OR|Bend OR).*') THEN 'Pacific Standard Time'
 ELSE 'Not Set/Outside of US'
END

Once you’ve set up your calculated field, you’ll need to add a control drop down to your Data Studio Report.

Within the drop down settings, choose the custom dimension you created and then you’re all set!

Summary

Bad data leads to bad decisions. By adding a time zone filter to your Google Data Studio Reports, you can make better decisions by looking at your data with a more accurate lens.

Stay in the know with email updates!

* indicates required