Make Google Analytics 4 Work for You
EPA content related to Google Analytics is changing.
Google's legacy platform, Universal Analytics (UA), will reach end of life in mid-2023 with a one-time extension for contracting clients such as EPA until July 1, 2024. See KB article.
In these Web Analytics pages, content for Universal Analytics is marked "Google Universal Analytics (legacy)."
Content for the new platform, Google Analytics 4, is marked "Google Analytics 4 (GA4)."
After you have created an account and learned the basics about Google Analytics (GA), you are ready to use GA data to analyze your own web content. Assistance is always available by contacting the Web analytics program, but users are encouraged to take advantage of training resources in order to develop proficiency in GA.
- Get an Overview of Available Data
- See User Actions Through Events
- Create Explorations
- Filter Data in Explorations
- Understand and Apply Segments
Get an Overview of Available Data
The home page and Reports area of GA4 give an overview of the various aspects of the EPA web presence, including www.epa.gov, sub-domains and non-epa.gov sites. The data is shown in progressive levels of details, from the home page (most general) to detailed reports such as Events Detail or Demographic Detail (most specific). See Home and reports Areas of GA4 for more information.
For more detailed reporting options, you will want to use the Explore area of GA4. See Understanding the Explore Area of GA4.
You may see differences in the data presented in Reports vs. Explorations in GA4. See this help article for explanation of expected differences.
See User Actions Through Events
Unlike Universal Analytics where page views were recorded as “hits” and separate from events, in Google Analytics 4, page views are just another kind of event. To see all events recorded in GA4, go to the Events Detail Report (Reports > Engagement > Events). When a user first interacts with the EPA web site, GA4 records a first_visit event and a session_start event. What is recorded between the session start and session end is a series of events representing everything the user did when interacting with the site. The session ends after 30 minutes of inactivity.
In GA4, events have parameters that give additional insight into user actions.
Some common events useful for EPA content owners:
click – a.k.a., outbound clicks, each time a user clicks a link that leads away from the current domain
this event has the parameters: link_classes, link_domain, link_id, link_url, outbound (boolean) which populate corresponding dimensions
downloads – when a user clicks a link leading to a file (with a common file extension)
this event has the parameters: file_extension, file_name, link_classes, link_domain, link_id, link_text, link_url which populate corresponding dimensions
external_link – a.k.a., outbound clicks, each time a user clicks a link that leads away from the current domain
this event has the parameters: link_classes, link_domain, link_id, link_url, outbound (boolean) which populate corresponding dimensions
file_download – when a user clicks a link leading to a file (with a common file extension)
this event has the parameters: file_extension, file_name, link_classes, link_domain, link_id, link_text, link_url which populate corresponding dimensions
first_visit – the first time a user visits a website
page_view - each time the page loads or the browser history state is changed by the active site
this event has the parameters: page_location (URL) and page_referrer (previous page URL) which populate corresponding dimensions
scroll – the first time a user reaches a certain point in the page (i.e., when a 95% vertical depth becomes visible), includes 25%, 50%, 75%, and 95%,
this event has no parameters but does populate the Percent scrolled dimension
session_start – when a user engages the app or website
view_search_results – each time a user interacts with a search results page (Google, Bing, or EPA Site Search)
this event has the parameters: search_term which populates the corresponding dimension
NOTE: In some cases, there two event names recorded for a user action. For example: file_download and downloads or external_link and click. If you find these give different results when applied to your pages or web area, use the one that gives the most complete representation of user activity (i.e. the one that gives the higher number). The EPA Analytics Team is aware of the issue and will work to remove confusing or redundant event names if possible.
Create Explorations
Unlike Universal Analytics where we had the ability to create custom reports, in GA4 we have basic reports in the Reports area and the ability to create “Explorations” in the Explore area.
Explorations are flexible in their structure, can have graphical or numeric output, and can include the dimensions and metrics we are most interested in. Customize the variables (segments, dimensions and metrics) and the tab settings (if outputting a data table, choose which variables to use for rows, columns and cell values). Appy filters to focus on a particular event type or web area. Once the report tab shows the data you want, download to your computer as a CSV or PDF file. In GA4, we do not have the ability to schedule a report be sent by Email.
Filter Data in Explorations
Without applying filters or segments, the EPA Enterprise GA property shows you data from across the EPA web presence, including www.epa.gov as well as epa.gov sub-domains and non-epa.gov domains. To focus the charts and tables on your specific web area or set of pages, you will need to use filters or segments.
A filter uses a single include/exclude criterion, can be combined with other filters using AND logic only, and limits the data shown in a single report tab.
The types of filters you can add to an exploration are: exactly matches, contains, begins with, ends with, matches regex, and the negative of each of these (e.g., does not exactly match).
For instance, you might create a filter for “Page location begins with https://www.epa.gov/lead” to limit output to only that web area. For more detail, see Using Filters in GA4.
In GA4 filters, you can also use RegEx (regular expressions). In RegEx, characters like “^” “[“ “]” “.” “$” “?” “*” have special meanings. For instance, an alternate version of the page location filter above using RegEx would look like this: Page location matches regex ^https://\.www\.epa\.gov/lead.*
NOTE: RegEx implemented in GA4 is different from RegEx in UA: GA4 RegEx is based on “full match” instead of “partial match” in UA RegEx. So most regular expressions that worked in UA will need to be tweaked to work in GA4. For more detail, see Google Help's Regular Expressions.
Understand and Apply Segments
While segments can be created with include/exclude filters, segments are very different from filters. Unlike filters, segments can use multiple include or exclude criteria, combined with OR or AND logic. Segments are most effective when they apply criteria to pre-limit the users or sessions the report will show data for.
A segment creates a subset of data and makes it available for an exploration (can be used in any and all report tabs). For instance, you might create a user segment for all mobile device users or all users who visited a particular set of pages or web area. For more detail, see Using Segments in GA4 .
Review Google’s Help section for more information on the segment builder.