googleapis
Version:
Google APIs Client Library for Node.js
1,459 lines • 507 kB
TypeScript
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace analytics_v3 {
export interface Options extends GlobalOptions {
version: 'v3';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* Google Analytics API
*
* Views and manages your Google Analytics data.
*
* @example
* ```js
* const {google} = require('googleapis');
* const analytics = google.analytics('v3');
* ```
*/
export class Analytics {
context: APIRequestContext;
data: Resource$Data;
management: Resource$Management;
metadata: Resource$Metadata;
provisioning: Resource$Provisioning;
userDeletion: Resource$Userdeletion;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* JSON template for Analytics account entry.
*/
export interface Schema$Account {
/**
* Child link for an account entry. Points to the list of web properties for this account.
*/
childLink?: {
href?: string;
type?: string;
} | null;
/**
* Time the account was created.
*/
created?: string | null;
/**
* Account ID.
*/
id?: string | null;
/**
* Resource type for Analytics account.
*/
kind?: string | null;
/**
* Account name.
*/
name?: string | null;
/**
* Permissions the user has for this account.
*/
permissions?: {
effective?: string[];
} | null;
/**
* Link for this account.
*/
selfLink?: string | null;
/**
* Indicates whether this account is starred or not.
*/
starred?: boolean | null;
/**
* Time the account was last modified.
*/
updated?: string | null;
}
/**
* JSON template for a linked account.
*/
export interface Schema$AccountRef {
/**
* Link for this account.
*/
href?: string | null;
/**
* Account ID.
*/
id?: string | null;
/**
* Analytics account reference.
*/
kind?: string | null;
/**
* Account name.
*/
name?: string | null;
}
/**
* An account collection provides a list of Analytics accounts to which a user has access. The account collection is the entry point to all management information. Each resource in the collection corresponds to a single Analytics account.
*/
export interface Schema$Accounts {
/**
* A list of accounts.
*/
items?: Schema$Account[];
/**
* The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Next link for this account collection.
*/
nextLink?: string | null;
/**
* Previous link for this account collection.
*/
previousLink?: string | null;
/**
* The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* An AccountSummary collection lists a summary of accounts, properties and views (profiles) to which the user has access. Each resource in the collection corresponds to a single AccountSummary.
*/
export interface Schema$AccountSummaries {
/**
* A list of AccountSummaries.
*/
items?: Schema$AccountSummary[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this AccountSummary collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this AccountSummary collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* JSON template for an Analytics AccountSummary. An AccountSummary is a lightweight tree comprised of properties/profiles.
*/
export interface Schema$AccountSummary {
/**
* Account ID.
*/
id?: string | null;
/**
* Resource type for Analytics AccountSummary.
*/
kind?: string | null;
/**
* Account name.
*/
name?: string | null;
/**
* Indicates whether this account is starred or not.
*/
starred?: boolean | null;
/**
* List of web properties under this account.
*/
webProperties?: Schema$WebPropertySummary[];
}
/**
* JSON template for an Analytics account ticket. The account ticket consists of the ticket ID and the basic information for the account, property and profile.
*/
export interface Schema$AccountTicket {
/**
* Account for this ticket.
*/
account?: Schema$Account;
/**
* Account ticket ID used to access the account ticket.
*/
id?: string | null;
/**
* Resource type for account ticket.
*/
kind?: string | null;
/**
* View (Profile) for the account.
*/
profile?: Schema$Profile;
/**
* Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in APIs console as a callback URL.
*/
redirectUri?: string | null;
/**
* Web property for the account.
*/
webproperty?: Schema$Webproperty;
}
/**
* JSON template for an Analytics account tree requests. The account tree request is used in the provisioning api to create an account, property, and view (profile). It contains the basic information required to make these fields.
*/
export interface Schema$AccountTreeRequest {
accountName?: string | null;
/**
* Resource type for account ticket.
*/
kind?: string | null;
profileName?: string | null;
timezone?: string | null;
webpropertyName?: string | null;
websiteUrl?: string | null;
}
/**
* JSON template for an Analytics account tree response. The account tree response is used in the provisioning api to return the result of creating an account, property, and view (profile).
*/
export interface Schema$AccountTreeResponse {
/**
* The account created.
*/
account?: Schema$Account;
/**
* Resource type for account ticket.
*/
kind?: string | null;
/**
* View (Profile) for the account.
*/
profile?: Schema$Profile;
/**
* Web property for the account.
*/
webproperty?: Schema$Webproperty;
}
/**
* JSON template for an Google Ads account.
*/
export interface Schema$AdWordsAccount {
/**
* True if auto-tagging is enabled on the Google Ads account. Read-only after the insert operation.
*/
autoTaggingEnabled?: boolean | null;
/**
* Customer ID. This field is required when creating a Google Ads link.
*/
customerId?: string | null;
/**
* Resource type for Google Ads account.
*/
kind?: string | null;
}
/**
* Request template for the delete upload data request.
*/
export interface Schema$AnalyticsDataimportDeleteUploadDataRequest {
/**
* A list of upload UIDs.
*/
customDataImportUids?: string[] | null;
}
/**
* JSON template for a metadata column.
*/
export interface Schema$Column {
/**
* Map of attribute name and value for this column.
*/
attributes?: {
[key: string]: string;
} | null;
/**
* Column id.
*/
id?: string | null;
/**
* Resource type for Analytics column.
*/
kind?: string | null;
}
/**
* Lists columns (dimensions and metrics) for a particular report type.
*/
export interface Schema$Columns {
/**
* List of attributes names returned by columns.
*/
attributeNames?: string[] | null;
/**
* Etag of collection. This etag can be compared with the last response etag to check if response has changed.
*/
etag?: string | null;
/**
* List of columns for a report type.
*/
items?: Schema$Column[];
/**
* Collection type.
*/
kind?: string | null;
/**
* Total number of columns returned in the response.
*/
totalResults?: number | null;
}
/**
* JSON template for an Analytics custom data source.
*/
export interface Schema$CustomDataSource {
/**
* Account ID to which this custom data source belongs.
*/
accountId?: string | null;
childLink?: {
href?: string;
type?: string;
} | null;
/**
* Time this custom data source was created.
*/
created?: string | null;
/**
* Description of custom data source.
*/
description?: string | null;
/**
* Custom data source ID.
*/
id?: string | null;
importBehavior?: string | null;
/**
* Resource type for Analytics custom data source.
*/
kind?: string | null;
/**
* Name of this custom data source.
*/
name?: string | null;
/**
* Parent link for this custom data source. Points to the web property to which this custom data source belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* IDs of views (profiles) linked to the custom data source.
*/
profilesLinked?: string[] | null;
/**
* Collection of schema headers of the custom data source.
*/
schema?: string[] | null;
/**
* Link for this Analytics custom data source.
*/
selfLink?: string | null;
/**
* Type of the custom data source.
*/
type?: string | null;
/**
* Time this custom data source was last modified.
*/
updated?: string | null;
/**
* Upload type of the custom data source.
*/
uploadType?: string | null;
/**
* Web property ID of the form UA-XXXXX-YY to which this custom data source belongs.
*/
webPropertyId?: string | null;
}
/**
* Lists Analytics custom data sources to which the user has access. Each resource in the collection corresponds to a single Analytics custom data source.
*/
export interface Schema$CustomDataSources {
/**
* Collection of custom data sources.
*/
items?: Schema$CustomDataSource[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this custom data source collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this custom data source collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* JSON template for Analytics Custom Dimension.
*/
export interface Schema$CustomDimension {
/**
* Account ID.
*/
accountId?: string | null;
/**
* Boolean indicating whether the custom dimension is active.
*/
active?: boolean | null;
/**
* Time the custom dimension was created.
*/
created?: string | null;
/**
* Custom dimension ID.
*/
id?: string | null;
/**
* Index of the custom dimension.
*/
index?: number | null;
/**
* Kind value for a custom dimension. Set to "analytics#customDimension". It is a read-only field.
*/
kind?: string | null;
/**
* Name of the custom dimension.
*/
name?: string | null;
/**
* Parent link for the custom dimension. Points to the property to which the custom dimension belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
*/
scope?: string | null;
/**
* Link for the custom dimension
*/
selfLink?: string | null;
/**
* Time the custom dimension was last modified.
*/
updated?: string | null;
/**
* Property ID.
*/
webPropertyId?: string | null;
}
/**
* A custom dimension collection lists Analytics custom dimensions to which the user has access. Each resource in the collection corresponds to a single Analytics custom dimension.
*/
export interface Schema$CustomDimensions {
/**
* Collection of custom dimensions.
*/
items?: Schema$CustomDimension[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this custom dimension collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this custom dimension collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* JSON template for Analytics Custom Metric.
*/
export interface Schema$CustomMetric {
/**
* Account ID.
*/
accountId?: string | null;
/**
* Boolean indicating whether the custom metric is active.
*/
active?: boolean | null;
/**
* Time the custom metric was created.
*/
created?: string | null;
/**
* Custom metric ID.
*/
id?: string | null;
/**
* Index of the custom metric.
*/
index?: number | null;
/**
* Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field.
*/
kind?: string | null;
/**
* Max value of custom metric.
*/
max_value?: string | null;
/**
* Min value of custom metric.
*/
min_value?: string | null;
/**
* Name of the custom metric.
*/
name?: string | null;
/**
* Parent link for the custom metric. Points to the property to which the custom metric belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* Scope of the custom metric: HIT or PRODUCT.
*/
scope?: string | null;
/**
* Link for the custom metric
*/
selfLink?: string | null;
/**
* Data type of custom metric.
*/
type?: string | null;
/**
* Time the custom metric was last modified.
*/
updated?: string | null;
/**
* Property ID.
*/
webPropertyId?: string | null;
}
/**
* A custom metric collection lists Analytics custom metrics to which the user has access. Each resource in the collection corresponds to a single Analytics custom metric.
*/
export interface Schema$CustomMetrics {
/**
* Collection of custom metrics.
*/
items?: Schema$CustomMetric[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this custom metric collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this custom metric collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* JSON template for Analytics Entity Google Ads Link.
*/
export interface Schema$EntityAdWordsLink {
/**
* A list of Google Ads client accounts. These cannot be MCC accounts. This field is required when creating a Google Ads link. It cannot be empty.
*/
adWordsAccounts?: Schema$AdWordsAccount[];
/**
* Web property being linked.
*/
entity?: {
webPropertyRef?: Schema$WebPropertyRef;
} | null;
/**
* Entity Google Ads link ID
*/
id?: string | null;
/**
* Resource type for entity Google Ads link.
*/
kind?: string | null;
/**
* Name of the link. This field is required when creating a Google Ads link.
*/
name?: string | null;
/**
* IDs of linked Views (Profiles) represented as strings.
*/
profileIds?: string[] | null;
/**
* URL link for this Google Analytics - Google Ads link.
*/
selfLink?: string | null;
}
/**
* An entity Google Ads link collection provides a list of GA-Google Ads links Each resource in this collection corresponds to a single link.
*/
export interface Schema$EntityAdWordsLinks {
/**
* A list of entity Google Ads links.
*/
items?: Schema$EntityAdWordsLink[];
/**
* The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Next link for this Google Ads link collection.
*/
nextLink?: string | null;
/**
* Previous link for this Google Ads link collection.
*/
previousLink?: string | null;
/**
* The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
}
/**
* JSON template for an Analytics Entity-User Link. Returns permissions that a user has for an entity.
*/
export interface Schema$EntityUserLink {
/**
* Entity for this link. It can be an account, a web property, or a view (profile).
*/
entity?: {
accountRef?: Schema$AccountRef;
profileRef?: Schema$ProfileRef;
webPropertyRef?: Schema$WebPropertyRef;
} | null;
/**
* Entity user link ID
*/
id?: string | null;
/**
* Resource type for entity user link.
*/
kind?: string | null;
/**
* Permissions the user has for this entity.
*/
permissions?: {
effective?: string[];
local?: string[];
} | null;
/**
* Self link for this resource.
*/
selfLink?: string | null;
/**
* User reference.
*/
userRef?: Schema$UserRef;
}
/**
* An entity user link collection provides a list of Analytics ACL links Each resource in this collection corresponds to a single link.
*/
export interface Schema$EntityUserLinks {
/**
* A list of entity user links.
*/
items?: Schema$EntityUserLink[];
/**
* The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Next link for this account collection.
*/
nextLink?: string | null;
/**
* Previous link for this account collection.
*/
previousLink?: string | null;
/**
* The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
}
/**
* JSON template for Analytics experiment resource.
*/
export interface Schema$Experiment {
/**
* Account ID to which this experiment belongs. This field is read-only.
*/
accountId?: string | null;
/**
* Time the experiment was created. This field is read-only.
*/
created?: string | null;
/**
* Notes about this experiment.
*/
description?: string | null;
/**
* If true, the end user will be able to edit the experiment via the Google Analytics user interface.
*/
editableInGaUi?: boolean | null;
/**
* The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This field is read-only.
*/
endTime?: string | null;
/**
* Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose status is ENDED.
*/
equalWeighting?: boolean | null;
/**
* Experiment ID. Required for patch and update. Disallowed for create.
*/
id?: string | null;
/**
* Internal ID for the web property to which this experiment belongs. This field is read-only.
*/
internalWebPropertyId?: string | null;
/**
* Resource type for an Analytics experiment. This field is read-only.
*/
kind?: string | null;
/**
* An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED.
*/
minimumExperimentLengthInDays?: number | null;
/**
* Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment.
*/
name?: string | null;
/**
* The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and servingFramework is one of "REDIRECT" or "API".
*/
objectiveMetric?: string | null;
/**
* Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED".
*/
optimizationType?: string | null;
/**
* Parent link for an experiment. Points to the view (profile) to which this experiment belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* View (Profile) ID to which this experiment belongs. This field is read-only.
*/
profileId?: string | null;
/**
* Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API to ENDED this field is set to STOPPED_BY_USER. This field is read-only.
*/
reasonExperimentEnded?: string | null;
/**
* Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status is ENDED.
*/
rewriteVariationUrlsAsOriginal?: boolean | null;
/**
* Link for this experiment. This field is read-only.
*/
selfLink?: string | null;
/**
* The framework used to serve the experiment variations and evaluate the results. One of:
* - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results.
* - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected variation.
* - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the selected variation and evaluating the results.
*/
servingFramework?: string | null;
/**
* The snippet of code to include on the control page(s). This field is read-only.
*/
snippet?: string | null;
/**
* The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has started. This field is read-only.
*/
startTime?: string | null;
/**
* Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" state. This field is required when creating an experiment.
*/
status?: string | null;
/**
* A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. This field may not be changed for an experiments whose status is ENDED.
*/
trafficCoverage?: number | null;
/**
* Time the experiment was last modified. This field is read-only.
*/
updated?: string | null;
/**
* Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING state. At least two variations are required before status can be set to RUNNING.
*/
variations?: Array<{
name?: string;
status?: string;
url?: string;
weight?: number;
won?: boolean;
}> | null;
/**
* Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only.
*/
webPropertyId?: string | null;
/**
* A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose status is ENDED.
*/
winnerConfidenceLevel?: number | null;
/**
* Boolean specifying whether a winner has been found for this experiment. This field is read-only.
*/
winnerFound?: boolean | null;
}
/**
* An experiment collection lists Analytics experiments to which the user has access. Each view (profile) can have a set of experiments. Each resource in the Experiment collection corresponds to a single Analytics experiment.
*/
export interface Schema$Experiments {
/**
* A list of experiments.
*/
items?: Schema$Experiment[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this experiment collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this experiment collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of resources in the result.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* JSON template for an Analytics account filter.
*/
export interface Schema$Filter {
/**
* Account ID to which this filter belongs.
*/
accountId?: string | null;
/**
* Details for the filter of the type ADVANCED.
*/
advancedDetails?: {
caseSensitive?: boolean;
extractA?: string;
extractB?: string;
fieldA?: string;
fieldAIndex?: number;
fieldARequired?: boolean;
fieldB?: string;
fieldBIndex?: number;
fieldBRequired?: boolean;
outputConstructor?: string;
outputToField?: string;
outputToFieldIndex?: number;
overrideOutputField?: boolean;
} | null;
/**
* Time this filter was created.
*/
created?: string | null;
/**
* Details for the filter of the type EXCLUDE.
*/
excludeDetails?: Schema$FilterExpression;
/**
* Filter ID.
*/
id?: string | null;
/**
* Details for the filter of the type INCLUDE.
*/
includeDetails?: Schema$FilterExpression;
/**
* Resource type for Analytics filter.
*/
kind?: string | null;
/**
* Details for the filter of the type LOWER.
*/
lowercaseDetails?: {
field?: string;
fieldIndex?: number;
} | null;
/**
* Name of this filter.
*/
name?: string | null;
/**
* Parent link for this filter. Points to the account to which this filter belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* Details for the filter of the type SEARCH_AND_REPLACE.
*/
searchAndReplaceDetails?: {
caseSensitive?: boolean;
field?: string;
fieldIndex?: number;
replaceString?: string;
searchString?: string;
} | null;
/**
* Link for this filter.
*/
selfLink?: string | null;
/**
* Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
*/
type?: string | null;
/**
* Time this filter was last modified.
*/
updated?: string | null;
/**
* Details for the filter of the type UPPER.
*/
uppercaseDetails?: {
field?: string;
fieldIndex?: number;
} | null;
}
/**
* JSON template for an Analytics filter expression.
*/
export interface Schema$FilterExpression {
/**
* Determines if the filter is case sensitive.
*/
caseSensitive?: boolean | null;
/**
* Filter expression value
*/
expressionValue?: string | null;
/**
* Field to filter. Possible values:
* - Content and Traffic
* - PAGE_REQUEST_URI,
* - PAGE_HOSTNAME,
* - PAGE_TITLE,
* - REFERRAL,
* - COST_DATA_URI (Campaign target URL),
* - HIT_TYPE,
* - INTERNAL_SEARCH_TERM,
* - INTERNAL_SEARCH_TYPE,
* - SOURCE_PROPERTY_TRACKING_ID,
* - Campaign or AdGroup
* - CAMPAIGN_SOURCE,
* - CAMPAIGN_MEDIUM,
* - CAMPAIGN_NAME,
* - CAMPAIGN_AD_GROUP,
* - CAMPAIGN_TERM,
* - CAMPAIGN_CONTENT,
* - CAMPAIGN_CODE,
* - CAMPAIGN_REFERRAL_PATH,
* - E-Commerce
* - TRANSACTION_COUNTRY,
* - TRANSACTION_REGION,
* - TRANSACTION_CITY,
* - TRANSACTION_AFFILIATION (Store or order location),
* - ITEM_NAME,
* - ITEM_CODE,
* - ITEM_VARIATION,
* - TRANSACTION_ID,
* - TRANSACTION_CURRENCY_CODE,
* - PRODUCT_ACTION_TYPE,
* - Audience/Users
* - BROWSER,
* - BROWSER_VERSION,
* - BROWSER_SIZE,
* - PLATFORM,
* - PLATFORM_VERSION,
* - LANGUAGE,
* - SCREEN_RESOLUTION,
* - SCREEN_COLORS,
* - JAVA_ENABLED (Boolean Field),
* - FLASH_VERSION,
* - GEO_SPEED (Connection speed),
* - VISITOR_TYPE,
* - GEO_ORGANIZATION (ISP organization),
* - GEO_DOMAIN,
* - GEO_IP_ADDRESS,
* - GEO_IP_VERSION,
* - Location
* - GEO_COUNTRY,
* - GEO_REGION,
* - GEO_CITY,
* - Event
* - EVENT_CATEGORY,
* - EVENT_ACTION,
* - EVENT_LABEL,
* - Other
* - CUSTOM_FIELD_1,
* - CUSTOM_FIELD_2,
* - USER_DEFINED_VALUE,
* - Application
* - APP_ID,
* - APP_INSTALLER_ID,
* - APP_NAME,
* - APP_VERSION,
* - SCREEN,
* - IS_APP (Boolean Field),
* - IS_FATAL_EXCEPTION (Boolean Field),
* - EXCEPTION_DESCRIPTION,
* - Mobile device
* - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile),
* - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet),
* - DEVICE_CATEGORY,
* - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field),
* - MOBILE_HAS_NFC_SUPPORT (Boolean Field),
* - MOBILE_HAS_CELLULAR_RADIO (Boolean Field),
* - MOBILE_HAS_WIFI_SUPPORT (Boolean Field),
* - MOBILE_BRAND_NAME,
* - MOBILE_MODEL_NAME,
* - MOBILE_MARKETING_NAME,
* - MOBILE_POINTING_METHOD,
* - Social
* - SOCIAL_NETWORK,
* - SOCIAL_ACTION,
* - SOCIAL_ACTION_TARGET,
* - Custom dimension
* - CUSTOM_DIMENSION (See accompanying field index),
*/
field?: string | null;
/**
* The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION.
*/
fieldIndex?: number | null;
/**
* Kind value for filter expression
*/
kind?: string | null;
/**
* Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use any match type; all other filters must use MATCHES.
*/
matchType?: string | null;
}
/**
* JSON template for a profile filter link.
*/
export interface Schema$FilterRef {
/**
* Account ID to which this filter belongs.
*/
accountId?: string | null;
/**
* Link for this filter.
*/
href?: string | null;
/**
* Filter ID.
*/
id?: string | null;
/**
* Kind value for filter reference.
*/
kind?: string | null;
/**
* Name of this filter.
*/
name?: string | null;
}
/**
* A filter collection lists filters created by users in an Analytics account. Each resource in the collection corresponds to a filter.
*/
export interface Schema$Filters {
/**
* A list of filters.
*/
items?: Schema$Filter[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Collection type.
*/
kind?: string | null;
/**
* Link to next page for this filter collection.
*/
nextLink?: string | null;
/**
* Link to previous page for this filter collection.
*/
previousLink?: string | null;
/**
* The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter.
*/
startIndex?: number | null;
/**
* The total number of results for the query, regardless of the number of results in the response.
*/
totalResults?: number | null;
/**
* Email ID of the authenticated user
*/
username?: string | null;
}
/**
* Analytics data for a given view (profile).
*/
export interface Schema$GaData {
/**
* Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request.
*/
columnHeaders?: Array<{
columnType?: string;
dataType?: string;
name?: string;
}> | null;
/**
* Determines if Analytics data contains samples.
*/
containsSampledData?: boolean | null;
/**
* The last refreshed time in seconds for Analytics data.
*/
dataLastRefreshed?: string | null;
dataTable?: {
cols?: Array<{
id?: string;
label?: string;
type?: string;
}>;
rows?: Array<{
c?: Array<{
v?: string;
}>;
}>;
} | null;
/**
* Unique ID for this data response.
*/
id?: string | null;
/**
* The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
*/
itemsPerPage?: number | null;
/**
* Resource type.
*/
kind?: string | null;
/**
* Link to next page for this Analytics data query.
*/
nextLink?: string | null;
/**
* Link to previous page for this Analytics data query.
*/
previousLink?: string | null;
/**
* Information for the view (profile), for which the Analytics data was requested.
*/
profileInfo?: {
accountId?: string;
internalWebPropertyId?: string;
profileId?: string;
profileName?: string;
tableId?: string;
webPropertyId?: string;
} | null;
/**
* Analytics data request query parameters.
*/
query?: {
dimensions?: string;
'end-date'?: string;
filters?: string;
ids?: string;
'max-results'?: number;
metrics?: string[];
samplingLevel?: string;
segment?: string;
sort?: string[];
'start-date'?: string;
'start-index'?: number;
} | null;
/**
* Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request.
*/
rows?: string[][] | null;
/**
* The number of samples used to calculate the result.
*/
sampleSize?: string | null;
/**
* Total size of the sample space from which the samples were selected.
*/
sampleSpace?: string | null;
/**
* Link to this page.
*/
selfLink?: string | null;
/**
* The total number of rows for the query, regardless of the number of rows in the response.
*/
totalResults?: number | null;
/**
* Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request.
*/
totalsForAllResults?: {
[key: string]: string;
} | null;
}
/**
* JSON template for Analytics goal resource.
*/
export interface Schema$Goal {
/**
* Account ID to which this goal belongs.
*/
accountId?: string | null;
/**
* Determines whether this goal is active.
*/
active?: boolean | null;
/**
* Time this goal was created.
*/
created?: string | null;
/**
* Details for the goal of the type EVENT.
*/
eventDetails?: {
eventConditions?: Array<{
comparisonType?: string;
comparisonValue?: string;
expression?: string;
matchType?: string;
type?: string;
}>;
useEventValue?: boolean;
} | null;
/**
* Goal ID.
*/
id?: string | null;
/**
* Internal ID for the web property to which this goal belongs.
*/
internalWebPropertyId?: string | null;
/**
* Resource type for an Analytics goal.
*/
kind?: string | null;
/**
* Goal name.
*/
name?: string | null;
/**
* Parent link for a goal. Points to the view (profile) to which this goal belongs.
*/
parentLink?: {
href?: string;
type?: string;
} | null;
/**
* View (Profile) ID to which this goal belongs.
*/
profileId?: string | null;
/**
* Link for this goal.
*/
selfLink?: string | null;
/**
* Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
*/
type?: string | null;
/**
* Time this goal was last modified.
*/
updated?: string | null;
/**
* Details for the goal of the type URL_DESTINATION.
*/
urlDestinationDetails?: {
caseSensitive?: boolean;
firstStepRequired?: boolean;
matchType?: string;
steps?: Array<{
name?: string;
number?: number;
url?: string;
}>;
url?: string;
} | null;
/**
* Goal value.
*/
value?: number | null;
/**
* Details for the goal of the type VISIT_NUM_PAGES.
*/
visitNumPagesDetails?: {
comparisonType?: string;
comparisonValue?: string;
} | null;
/**
* Details for the goal of the type VISIT_TIME_ON_SITE.
*/
visitTimeOnSiteDetails?: {
comparisonType?: string;
comparisonValue?: string;
} | null;
/**
* Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY.
*/
webPropertyId?: string | null;
}
/**
* A goal collection lists Analytics goals to which the user has access. Each view (profile) can have a set of goals. Each resource in the Goal collection corresponds to a single Analytics goal.
*/
export interface Schema$Goals {
/**
* A list of goals.
*/
items?: Schema$Goal[];
/**
* The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 wi