Google Analytics 4 (GA4) add-on for Google Sheets

Easily configure your reports and download Google Analytics 4 data to Google Sheets.

This Google Sheets add-on helps you view and edit Google Analytics 4 data more easily in Google Sheets.

  • Easy to use report configurator
  • Schedule your reports to run and update automatically
  • Compare two periods and sort by the delta of the metrics
  • Receive an email when your report is ready
  • Easily create reports with data from multiple Google Analytics 4 properties


Awesome and fast plugin when you want to extract data from GA4 tot Google Spreadsheet! Easy to use but also great support when you have questions.
Willem Bijenhof, Valantic


Great add-on 👌🏻 Works great, super fast and is very affordable. They took a lot of time to answer questions that I had. Really great product.
Leon Korteweg, freelance

Get your subscription

You can use this Google Analytics 4 add-on for Google Sheets for free for 14 days. If you wish to continue using the add-on after the free trial period, please subscribe. Each subscription includes:

  • Unlimited GA4 properties
  • Unlimited reports (Google's quotas and Sheets limits apply.)
  • Up to hourly automated refreshes
  • Email support

Install the Google Sheets add-on

To use the Reporting for Google Analytics 4 add-on, you must first add it to your spreadsheet. The following instructions will guide you through the process:

  1. Create a new Google spreadsheet (or open an existing one).
  2. In the menu bar choose: Extensions > Add-ons > Get add-ons
  3. Find the “Reporting for Google Analytics 4” add-on in the add-on gallery and select it.
  4. On the add-on description page, click install in the top right corner to add this add-on to your spreadsheet.
  5. A dialog should appear asking for permission for the add-on to access your Google Analytics 4 data. Click on "Allow".
  6. The add-on is now installed. The "Reporting for Google Analytics 4" submenu should now appear in the Extensions menu.

You can also go directly to the add-on in the Google Workspace Marketplace. Here you can install the add-on. The add-on is then available in every Google Spreadsheet under "Extensions".

Create GA4 reports

Reports can be created manually in the configuration sheet or using the add-on's sidebar. To use the sidebar, select "Extensions" > "Reporting for Google Analytics 4" > "Create report" in the menu bar.
This will display a sidebar on the right side with which you can easily create a report configuration. The sidebar helps with the following:

  • Look up Google Analytics 4 account and property information.
  • Selecting dimensions and metrics. Including custom metrics, dimensions, events and conversions.
  • Apply simple metric filters.
  • Apply simple dimension filters.
  • Determine the sorting of the report.

When you are done, click on the button "Add report to sheet" and your report configuration will appear in the sheet called “Configuration GA4 reports” (if this sheet does not already exist, it will be created).

You can go through these steps again to add another report. You can also copy the information in the sheet to a new column and edit it in the sheet.
Not all cells are filled by the sidebar. The fields that are not filled by the sidebar can be entered in the sheet.

Edit GA4 reports

There are two ways to edit reports after you create them:

  • Through the add-on menu, you can select 'Manage reports'. A sidebar will open with a list of the reports currently in your sheet. You can click the edit option for the report you wish to edit and the sidebar will display your current report configuration. You can make adjustments in the sidebar and save the report configuration to the sheet.
  • Another option is to edit the report configuration directly in the sheet.

Delete GA4 reports

There are two ways to delete reports after you create them:

  • Through the add-on menu, you can select 'Manage reports'. A sidebar will open with a list of the reports currently in your sheet. You can click the delete option for the report you wish to delete. After you confirm your intention to delete the report, the report configuration will be removed from your sheet.
  • Another option is to delete the report configuration directly in the sheet.

Run reports

Go to "Extensions" > "Reporting for Google Analytics 4" > "Run reports" in the menu to run all the reports you have created.

Schedule reports to run automatically

Reports can be scheduled to run automatically. To do this, go to "Extensions" > "Reporting for Google Analytics 4" > "Schedule Reports".
A dialog will open in which you can indicate three things:

  • Turning a schedule on and off.
  • Choose the frequency, day and time.
  • Set whether you want to receive an email if the execution of a report fails.

The schedule uses the time zone of the spreadsheet. To update the time zone got to: "File" > "Settings" in the Google Sheets menu. If no time zone is set the schedule uses Coordinated Universal Time (UTC). If you change the time zone, you will have to set the schedule again to use the new time zone.

Quotas

This Google Sheets add-on uses the Google Analytics data API. The use of this API is limited by Google. Here you can see which quotas apply: https://developers.google.com/analytics/devguides/reporting/data/v1/quotas

Report configuration options

Option Required Description
Report name Yes The name you give to the report. The name must be unique. If the name is not unique, a sequence number is automatically added to make it unique. The report name is also the name of the sheet to which the data is written.
Property id Yes The ID of the Google Analytics 4 property. You can use the sidebar to find out the id. You can also find the ID in the Google Analytics 4 UI (in the admin section or the url).
Property name The name of the Google Analytics 4 property. The property name is filled in by the sidebar. If you enter a report configuration directly to the sheet and leave the property name empty. it will be fetched on the first run of the report.
Start date Yes The start date for retrieving Analytics data. You can specify a specific start date formatted as YYYY-MM-DD or as a relative date.
Options for specifying a relative date:
  • XdaysAgo (X is a positive integer, for example 7daysAgo)
  • yesterday
  • sundayLastWeek
  • mondayLastWeek
  • fridayLastWeek
  • SaturdayLastWeek
View all possible options for relative dates.

You can also use the date functions of Google Sheets to specify this value programmatically. For example, the following expression returns the last day of the previous month: =EOMONTH(TODAY(), -1)
End date Yes The end date for retrieving Google Analytics 4 data. You can specify a specific end date formatted as YYYY-MM-DD or as a relative date.
Options for specifying a relative date:
  • XdaysAgo (X is a positive integer, for example 7daysAgo)
  • yesterday
  • sundayLastWeek
  • mondayLastWeek
  • fridayLastWeek
  • SaturdayLastWeek
View all possible options for relative dates

You can also use the date functions of Google Sheets to specify this value programmatically. For example, the following expression returns the last day of the previous month: =EOMONTH(TODAY(), -1)
Compare start date This is the start date of the date range you want to compare your Google Analytics 4 data with.
You can specify a specific date formatted as YYYY-MM-DD or as a relative date.
Options for specifying a relative date:
  • XdaysAgo (X is a positive integer, for example 7daysAgo)
  • yesterday
  • sundayLastWeek
  • mondayLastWeek
  • fridayLastWeek
  • SaturdayLastWeek
View all possible options for relative dates

You can also use the date functions of Google Sheets to specify this value programmatically. For example, the following expression returns the last day of the previous month: =EOMONTH(TODAY(), -1)
Compare end date This is the end date of the date range you want to compare your Google Analytics 4 data with.
You can specify a specific date formatted as YYYY-MM-DD or as a relative date.
Options for specifying a relative date:
  • XdaysAgo (X is a positive integer, for example 7daysAgo)
  • yesterday
  • sundayLastWeek
  • mondayLastWeek
  • fridayLastWeek
  • SaturdayLastWeek
View all possible options for relative dates

You can also use the date functions of Google Sheets to specify this value programmatically. For example, the following expression returns the last day of the previous month: =EOMONTH(TODAY(), -1)
Metrics Yes A list of metrics for the report. Metrics can be specified in two ways:
In most scenarios, a list of metric ids will suffice. JSON allows you to create a mathematical expression for derived metrics. For example, the number of events per user is eventCount/totalUsers.
Dimensions Yes A list of dimensions for the report. Dimensions can be specified in two ways:
In most scenarios, a list of dimensions ids will suffice. JSON allows you to create a dimensionExpression. One dimension can then be the result of an expression of several dimensions. For example dimension "country, city": concatenate(country, ", ", city).
Metric filters Filters can be used to limit the data in the report. Metric filters can be specified in two ways:
While the text expression is easier to read, JSON can be more flexible in complex scenarios.
Dimension filters Filters can be used to limit the data in the report. Dimension filters can be specified in two ways:
Order by This determines how the rows are sorted in the report. By default, the reports are sorted by the first metric descending. But you can adjust this in two ways:
While the text expression is easier to read, JSON can be more flexible in complex scenarios.
Limit The maximum number of rows for the report. If this parameter is left empty, all rows are shown.
Currency code A currency code in ISO 4217 format, such as "USD", "EUR", "JPY". If the field is empty, the report uses the default currency of the Google Analytics 4 property.
Include empty rows If the value here is FALSE or not specified, then only rows are included where at least one of the metrics has a value above 0. If the value is TRUE, these rows are displayed.
Email addresses The email addresses to which this report should be sent. The report is only sent if the report contains at least 1 row of data. Leave this field blank to not send the report.
Delta order When two periods are compared, the report is sorted by the delta of the first metric. By default, the sorting is "descending", but you can change this to "ascending" by entering "ascending" here. This only works when the "Order by" field is empty, otherwise the expression in the "Order by" field is applied to the dimensions or the metrics of the first date range.
Delta threshold Enter a numeric value to limit the rows displayed based on a minimum or maximum value of the delta (the difference between the periods for the first metric). When the report is ordered descending, only rows with a delta equal to or greater than the threshold are shown. When the report is ordered ascending only rows with a delta less than or equal to the threshold are shown.
Skip report If TRUE, the report in the corresponding column is not executed.
Separator Here you can define the separator that is used with the metrics filters, dimension filters and order by text expressions. The separator is only needed if the value is entered using a text expression. When the value is entered as JSON, the separator is not needed. A separator is used to properly interpret the text expression for the metric filter, dimension filters and order by. By default, this separator is two underscores (__). When two underscores occur (one after the other) in one of the fields or in the value, this can lead to conflicts. In this case, you can set a different separator (for example: _**_).
Spreadsheet URL The report is written to the current spreadsheet by default. Enter the URL of a different Google Sheets spreadsheet to write the report to that spreadsheet. You can give this add-on access to the other spreadsheet by sharing the spreadsheet with "ga4-add-on@adformatic-tools.iam.gserviceaccount.com" (This service account needs editor access to be able to write to the spreadsheet.)
Show quotas By default, the used and remaining quotas are not shown in the header of the report. Set this value to "TRUE" to display the quotas. More information about Google's quotas: https://developers.google.com/analytics/devguides/reporting/data/v1/quotas
Hide report Header By default, extra information and the totals are shown above the report. Set the value to "TRUE" to hide this report header. The report then starts at row 1.
First column By default, the report data begins in the first column. However, you can alter this by specifying a different starting column number, such as 3, for the report to begin in column 3.
Disable formatting The report data is automatically styled for easy reading in Google Sheets, including currency symbols and thousand separators. To disable this feature, set the value to "TRUE".
Update mode There are three update modes available:
  1. OVERWRITE: This is the default mode, the report data overwrites any previous report data.
  2. APPEND: Set this field to "APPEND" if you wish to append the new data to the existing report data. If one of the following date dimensions is included in the report: "date", "isoYearIsoWeek", "yearWeek", "yearMonth", "year", rows with the same value for this dimension will be overwritten by the new report data. This allows you to, for example, set a report to run daily and add data from the last three days, ensuring you always have the most recent data. (Note: Google Analytics 4 may require more than 24 hours to process all data.) This mode may require more processing time, so consider limiting the number of reports per spreadsheet.
  3. APPEND_SIMPLE: This mode appends the data from the new report below the existing data in the sheet. It's efficient and quick but does not overwrite data with matching dates.

Note: When "APPEND" or "APPEND_SIMPLE" is used, the total values are disabled. Furthermore, appending data is not possible when comparing two date ranges.
Last update on This is a read only field. This field is filled by the add-on, so you can easily when a report was last updated.

Overview available relative dates

Relative dates:

  • XdaysAgo (X is a positive integer, for example 7daysAgo)
  • today
  • yesterday
  • mondayThisWeek
  • lastSunday
  • sundayLastWeek
  • mondayLastWeek
  • fridayLastWeek
  • saturdayLastWeek
  • sunday2WeekAgo
  • monday2WeekAgo
  • friday2WeekAgo
  • saturday2WeekAgo
  • firstDayThisMonth
  • firstDayLastMonth
  • lastDayLastMonth
  • firstDay2MonthsAgo
  • lastDay2MonthsAgo
  • firstDayThisYear

Relative dates last year

  • XdaysAgoLastYear (X is a positive integer, for example 7daysAgoLastYear)
  • sundayLastWeekLastYear
  • mondayLastWeekLastYear
  • fridayLastWeekLastYear
  • saturdayLastWeekLastYear
  • firstDayLastMonthLastYear
  • lastDayLastMonthLastYear
  • firstDayLastYear

Write a filter expression as text expression

A filter expression can limit the number of rows based on the values of the metrics or the values of the dimensions in the report.

Metric filters as text expression

A metric filter filters based on the value of the metrics.
A metric filter expression always consists of three parts:

  • A metric (e.g. sessions)
  • An operator (e.g. greater than (>))
  • A value (e.g. 30)

An example of a filter is:

sessions__>__30

This filter ensures that only rows with more than 30 sessions are included. Rows with 30 sessions or less are not included in the report.

Metric operators
The following operators are available for metric filters:

  • Greater than: >
  • Less than: <
  • Greater than or equal to: >=
  • Less than or equal to: <=
  • Equal to: =

Dimension filters as text expression

A dimension filter filters based on the value of the dimensions. A dimension filter expression always consists of three parts:

  • A dimension (e.g. sessions)
  • An operator (e.g. contains)
  • A value (e.g. “google”)

An example of a filter is:

sessionSource__contains__google

This filter ensures that only rows where the sessionSource contains "google" are included. Rows where the sessionSource does not contain “google” are not included in the report.

Dimension operators

The following operators are available for dimension filters:

  • CONTAINS
  • BEGINS_WITH
  • ENDS_WITH
  • EXACT
  • FULL_REGEXP
  • PARTIAL_REGEXP

Include or exclude

By default, a filter will ensure that a report only contains data that meets the condition. It is also possible to exclude this data.

For example, an expression to exclude data looks like this:

NOT__sessions__>__30

This filter ensures that the report only contains rows with 30 sessions or less.

NOT__sessionSource__contains__google

This filter ensures that the report only contains rows where "google" does not appear in the sessionSource.

Separator

The Google Analytics Data API (for Google Analytics 4) only accepts filters in the form of JSON. This Google Sheets add-on can interpret a string of text and convert it to JSON. In Google Analytics 4 it is possible to define custom metrics, custom dimensions, events and conversions. There are no naming restrictions for custom dimensions and metrics, and there are few restrictions for event names and conversions either.

In order to be able to interpret the text string properly, a separator is used. By default, this separator is two underscores (__). When two underscores occur (one after the other) in one of the fields or in the value, this can lead to conflicts. In this case, you can set a different separator (for example: _**_).

With a custom separator, the previously mentioned example would look like this:

sessions_**_>_**_30

Combine filter expressions

Filter expressions can be combined with each other. This can be done in two ways:

  • AND: In this case both filter expressions must be TRUE (before and after pairing with AND).
  • OR: In this case only one of the two conditions mest be TRUE

Examples of a combined filter expression are:

sessions__>__30__AND__newUsers__>__20

sessions__>__30__OR__purchaseRevenue__>__0

A hyphen is always preceded and followed by a separator.

Filters for dimensions and metrics cannot be combined in one expression. The filters for dimensions and metrics must be specified separately.

Set priority

If you want to combine more than two filter expressions, it may be necessary to prioritize them in order to group the correct expressions together. This can be done by adding parentheses. The expressions in parentheses are executed first.

Examples of prioritization with parentheses:

sessions__>__30__OR__(newUsers__>__20__AND__sessions__>__20)
eventName__EXACT__Lead__AND__(country__EXACT__Germany__OR__country__EXACT__France__OR__country__EXACT__Belgium)

Order by as text expression

With an order by text expression you can determine how a report is sorted.

An order by expression always consists of two parts:

  • The name of a metric or dimension
  • The direction, there are two options for this:
    • desc (descending)
    • asc (ascending)

An example of an order by expression is:

newUsers__asc

This rule sorts the report in ascending order by the newUsers metric.

A separator is used between the name of the dimension or metric and the direction. By default, this separator is two underscores (__). When this separator conflicts with your dimensions or metrics, you can adjust the separator. This can be done in the spreadsheet in the row “Separator”.

Order by rules can also be combined with each other. This can be done by separating the expressions with a comma.
An example of a combined expression is:

newUsers__desc, city__asc

This rule sorts the report descending by the newUsers metric and ascending by city.
Dimensions are sorted alphabetically and are case insensitive. When this is undesirable, enter the order by rules as JSON.

Terms

For more information please visit our terms and conditions and privacy policy.

Questions and feature requests

If you have a question or a feature request. Please contact us.