D toc |
---|
D s ed | ||||
---|---|---|---|---|
|
Excerpt | ||||
---|---|---|---|---|
|
Limitations and Requirements
D s conn req sql |
---|
Info |
---|
NOTE: Most interactions with the Google Analytics datastore are formed as custom SQL queries. More information on syntax and examples is provided below. |
OAuth 2.0 authentication is required.
An OAuth 2.0 web client must be available for use in the
.D s webapp type Portal - You cannot create OAuth 2.0 connections via API.
The following schema is supported:
UniversalAnalytics
.Tip Tip: This schema was previously called
GoogleAnalytics
by the driver vendor.
allows up to 10 metrics and seven dimensions in a single query.D s conntype type google_analytics When issuing a query that selects all columns, only the default Metric columns are selected for tables with more than 10 Metrics.
The default Dimensions are used unless you explicitly select other dimension columns.
All reports in
must cover a specific date range.D s conntype type google_analytics The default behavior is to pull the last month of data if the StartDate and EndDate inputs are left unset.
To override this behavior, the values can be set directly in the query.
Create Connection
via
D s webapp | ||
---|---|---|
|
When you create the connection, please review the following properties and specify them accordingly:
Connection Property | Description | ||||||
---|---|---|---|---|---|---|---|
View Id | Unique identifier of the view
| ||||||
Connect String Options | The following is the default connect string option:
| ||||||
OAuth2 Client | The client is displayed.
| ||||||
Default Column Data Type Inference | Leave this value as Enabled . |
For more information, see the driver documentation http://cdn.cdata.com/help/DAG/jdbc/default.htm.
Connect String Options
Enhanced SQL
By default, the following connect string options is included. This option enables an enhanced form of SQL support for the connection.
Code Block |
---|
SupportEnhancedSQL=true; |
When this feature is enabled:
- In-memory processing that is handled by default in the querying application (
) is passed to Google Analytics for processing.D s webapp type Portal - This feature enables the use of advanced SQL expressions, such as the use of more predicates, joins, and aggregations.
For more information on enhanced SQL for Google Analytics, see https://cdn.cdata.com/help/DAG/jdbc/RSBGoogleAnalytics_p_SupportEnhancedSQL.htm.
Data Type Conversions
For more information, see the driver documentation http://cdn.cdata.com/help/DAG/jdbc/.
Example queries:
To import data from Google Analytics, you typically create a custom SQL SELECT statement. Example:
Code Block |
---|
SELECT distinct Date, Sessions, NewUsers, BounceRate, PageviewsPerSession, AvgSessionDuration, Browser, FROM GoogleAnalytics.Traffic where StartDate = '90DaysAgo' and EndDate ='Today' |
Info |
---|
NOTE: The |
- Do not apply quotes, double-quotes, or brackets around field or table values.
- Literal values should be in single quotes.
StartDate
andEndDate
parameters can be used to specify a date range.- You can also use date literal functions to specify date ranges. For more information, see http://cdn.cdata.com/help/DAG/jdbc/pg_dateliteralfunctions.htm.
For more information:
- SQL syntax: http://cdn.cdata.com/help/DAG/jdbc/pg_overview.htm
- SQL examples: http://cdn.cdata.com/help/DAG/jdbc/pg_retrievingdata.htm
D s also | ||
---|---|---|
|