Connecting to Google Analytics
Applicable to Sisense on Linux and Microsoft Windows
Sisense enables easy and quick access to tables contained within Google Analytics. The steps below describe how to connect to this type of data source.
Note: Google Analytics provides a quota on the free daily API requests. For this reason a developer key must be supplied. Read more details about Quota Limits.
Note: Google Analytics for Linux is supported from Sisense 7.4.1.
Note: If you are connecting to a Google service remotely, and the address of Sisense is something other than localhost, Google requires that you connect using the OAuth 2.0 protocol. See Google Authentication for more information. If you are on a Linux deployment, see Google Authentication in Linux.
Note: For the list of supported connectors, see Introduction to Data Sources.
To import Google Analytics data:
- In the Data page, open an ElastiCube or click to create a new ElastiCube.
- In the Model Editor, click . The Add Data dialog box is displayed.
Note: If you are running an ad blocker, you might encounter an error. Disable any ad blockers for Sisense and try again.
- In the Add Data dialog box, select Google Analytics.
- Click Sign in with Google and enter your email, and then select Next to enter your password. If you have multiple accounts, select the account that has the Google Analytics data you want to access and enter the password, if you're not already signed in.
- Click Accept to allow your Sisense Server to access your Google Analytics data.
- Close the browser window when notified to do so.
- Click Next. All tables and views associated with Google Analytics are displayed.
- From the Tables list, select the relevant table or view you want to work with. You can click next to the relevant table or view to see a preview of the data inside it. When you select the table or view, a new option is displayed at the bottom of the list, Add Import Query.
- (Optional) Click + to customize the data you want to import with SQL. See Importing Data with Custom Queries for more information.
- After you have selected all the relevant tables, click Done. The tables are added to your schema.
See Customizing Google Analytics and Google Ads Tables for in-depth info on controlling your Google Analytics tables.
Avoiding Sampling in Google Analytics
Google Analytics applies sampling whenever more than 500,000 sessions are returned within a given query. For example, if we are asking for a 1-month time period that had 1,000,000 session in it, Google will apply sampling and we will only get 50% of the actual sessions. Whereas in some cases sampling might only slightly affect the results accuracy, it many cases it is crucial.
Sisense supports three configuration options to reduce the chances of sampling:
While these configuration options may reduce the chances that Google samples your data, Sisense cannot guarantee that your data will not be sampled as the data is extracted from Google.
- Split Intervals: A Google Analytics table can be configured to be split into a number of given intervals. For example, if intervals=4, then a one month period will be split into 4 query requests equal in days.
- Day Intervals: A Google Analytics table can be configured to be split into multiple intervals where each is the size of the given number of days. For example, if day_intervals=10, then a 30 day time period will be split into 3 intervals.
- Segmenting Data: A segment is a subset of your data. You can use predefined segments to work around Google’s sampling limitations. For more information, see Segmenting Google Analytics Data.
Since Google limitations are applied separately per request, this reduces the risk of overall sampling.
Configuring Google Analytics Sampling Intervals
Edit the following XML file (if it doesn’t exist, create it). The location of the file depends on your version of Sisense:
Before V8.2.2 (CLR connector):
V8.2.2 and later (JVM connector):
The xml file needs to have a table node for each table, under a tables root:
<?xml version="1.0" encoding="utf-8" ?>
<table name="MyGoogleAnalyticsTable" days_interval="2" split_by="10"/>
For Split Intervals as described above use the “split_by” attribute. For Day Intervals use the “days_interval” attribute.
Note that only one of these attributes should be used. “split_by” will be used in case both are available.
It is easy to estimate the amount of sessions your account generates from your Google Analytics account:
Google Analytics Dashboard Example
Sisense has created two Google Analytics dashboard examples to help you create dashboards from the Google Analytics data set. To learn more:
- For the Google Analytics - Visits dashboard, click here.
- For the Google Analytics - Revenue and Transactions dashboard, click here.