DefaultQueryOptions
- Last Updated: May 12, 2023
- 2 minute read
- DataDirect Connectors
- JDBC
- Documentation
Purpose
Specifies the values of Google Analytics 4 query parameters for WHERE clause filtering during a session. Providing values for these parameters simplifies queries.
Valid Values
(key=value[;key=value])
where:
key
is one of the following query parameters:
startDate: The inclusive starting date for the query with Report API. The default is30daysago(thirty days prior to the current date).endDate: The inclusive ending date for the query with Report API. The default isyesterday(the day prior to the current date).startMinutesAgo: The inclusive start minutes for the query with Realtime Report API. The default is29(twenty-nine minutes prior to the current time).endMinutesAgo: The inclusive end minutes for the query with Realtime report API. The default is0(current time).currencyCode: A currency code in ISO4217 format, such asAED,USD,JPY. If the field is empty, the Report API uses the property's default currency. There is no default.keepEmptyRows: If set tofalseor unspecified, each row with all metrics equal to 0 will not be returned with Report API. If set totrue, these rows will be returned if they are not separately removed by a filter. The default isfalse.returnPropertyQuota: If set totrue, Report or Realtime API will return the current state of this Analytics Property's quota. The default isfalse.accountId: A Google Analytics 4 Account ID. An Account ID is needed for analytics admin APIs. There is no default.propertyId: A Google Analytics 4 Property ID. A Property ID is needed for analytics data APIs. A Property ID can be obtained from your Google Analytics dashboard (Dashboard>Admin>Property>Property Settings>PROPERTY ID). There is no default.
Notes
-
Important: In order for
SELECT * FROMto work in a query with the Data API,propertyIdmust be specified. IfpropertyIdis not specified using DefaultQueryOptions, then it must be set explicitly in the WHERE clause. -
Important: In order for
SELECT * FROMto work in a query with the Admin API,accountIdmust be specified. IfaccountIdis not specified using DefaultQueryOptions, then it must be set explicitly in the WHERE clause. -
The syntax for
startDateandendDatevalues is as follows:- A date in the format YYYY-MM-DD
- The word
todayfor the current date - The word
yesterdayfor the day prior to the current date - nn
daysAgowhere nn is a number of days prior to the current date
Data Source Methods
public String getDefaultQueryOptions()
public void setDefaultQueryOptions(String)
Default Value
If no value is specified (the default), the driver uses the following values: startDate=30daysAgo;endDate=yesterday;startMinutesAgo=29;endMinutesAgo=0.
Data Type
String