Import Google Analytics Data

The Google Analytics integration lets you import your Google Analytics data โ€” provided by the Google Analytics Reporting API โ€” into your relational databases.

Deprecation

From December 2021, we are no longer supporting the new version of importing data from Google Analytics. Please check out the announcement and suggested solution here.

Step Setup#

1. Create a Google Analytics data source#

https://secure.holistics.io/manage/data_sources

Holistics will first request your permission to access your Google Analytics data. The credentials will be saved for further uses.

2. Import Your Data#

https://secure.holistics.io/data_imports
  • Select a Property and a Analytics View
  • Select Metrics (required), Dimensions, and Date Range to preview your data.
  • You can also customize your query with Filter. Here are some basic syntax:

Metric Filters

OperatorDescriptionExamples

==

Equals

ga:timeOnPage==10

!=

Does not equal

ga:timeOnPage!=10

Greater than

ga:timeOnPage>10

<

Less than

ga:timeOnPage<10

>=

Greater than or equal to

ga:timeOnPage>=10

<=

Less than or equal to

ga:timeOnPage<=10

Dimension Filters

OperatorDescriptionExample

==

Exact match

ga:country==Singapore

!=

Does not match

ga:country!=Singapore

=@

Contains substring

ga:country=@si

!@

Does not contain substring

ga:country!@si

=~

Contains a match for the regular expression

ga:country=~^s.*

!~

Does not match regular expression

ga:country!~^s.*

Combining filters

  • OR: using a comma (,) to define OR operator. Examples:
ga:country==Hong Kong,ga:country=Canada
  • AND: using a semi-colon (;) to define AND operator. Example:
ga:browser==Firefox;ga:operatingSystem==Windows,ga:operatingSystem==Macintosh

Please follow the Filter Syntax for more information.

For an in-depth guide about Google Analytics dimensions and metrics, please refer to this guide by Google: Dimensions and metrics

  • Click Validate query to Preview your data

Note: Google Analytics only allows a maximum number of 7 Dimensions and 10 Metrics.

Relative Date#

Please note that Holistics allows users to select relative date range when importing Google Analytics.

With this feature, you could get the newest data from Google Analytics by setting the End Date to a relative date (for example, Yesterday, a Week ago, etc.) rather than a Specific Date (2019-01-05)

3. Select Destination#

  • The final step is to select a destination data source for storing the Google Analytics data

Note About Sampling#

Google Analytics may or may not return sampled data based on your query (dimensions and metrics). When sampling is applied, Holistics will try to import the most accurate data provided.

Auto-import data from Google Analytics to Database#

For example, if you want to import your Google Analytics Data weekly, you need to choose a relative date range (7 days ago - yesterday)

By doing this, your Data from Google Analytics will always be updated from a week ago to yesterday of your current date. Therefore, you will always get weekly updated data from Google Analytics going to your Database