Google Analytics 4 add-on for Google Sheets

Google Analytics 4 add-on for Google Sheets

Google Analytics 4 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.

Watch the demo video

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”.

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




  • Easy to use report configurator



  • Automatically update reports



  • Query and report data from multiple properties



  • Sort reports by deltas

Configure your Google Analytics 4 reports

With this handy Google Sheets add-on you can download a report with Google Analytics 4 data without technical knowledge. In the side bar you can easily search and select dimensions and metrics. Your custom dimensions, metrics, and conversions are included in the sidebar. You can then easily add filters to refine the report.

Update report automatically

Your reports can be run automatically according to a configurable schedule. This keeps the data in your reports and dashboards up to date.

Email updates

You can receive an email when a report has been completed. The e-mail will only be sent if the report contains at least 1 row of data.

Receive an email alert for major changes

You can retrieve data for two periods and compare it with each other. The data is then sorted by the absolute delta of the first metric. By setting a minimum for the delta, you will only receive an email when the differences are large enough.

Create 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.

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:

While the text expression is easier to read, JSON can be more flexible in complex scenarios.

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.
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 By default, the report is written to the current spreadsheet. The report can be written to another spreadsheet instead of the current spreadsheet. Enter the URL of the Google spreadsheet to which the report should be written.
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.

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

You can use this Google Sheets add-on for free. We may introduce a subscription model in the future.
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.

Kennisgeving: Voor dit product is een JavaScript vereist.

Exit mobile version