google_analytics
Creates, updates, deletes, gets or lists a google_analytics
resource.
Overview
Name | google_analytics |
Type | Resource |
Id | firebase.firebase.google_analytics |
Fields
The following fields are returned by SELECT
queries:
SELECT
not supported for this resource, use SHOW METHODS
to view available operations for the resource.
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
add_google_analytics | insert | projectsId | Links the specified FirebaseProject with an existing Google Analytics account. Using this call, you can either: - Specify an analyticsAccountId to provision a new Google Analytics property within the specified account and associate the new property with the FirebaseProject . - Specify an existing analyticsPropertyId to associate the property with the FirebaseProject . Note that when you call AddGoogleAnalytics : 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in the FirebaseProject (based on the packageName or bundleId associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies to AndroidApps and IosApps . 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the Analytics documentation. The result of this call is an Operation . Poll the Operation to track the provisioning process by calling GetOperation until done is true . When done is true , the Operation has either succeeded or failed. If the Operation succeeded, its response is set to an AnalyticsDetails; if the Operation failed, its error is set to a google.rpc.Status. To call AddGoogleAnalytics , a project member must be an Owner for the existing FirebaseProject and have the Edit permission for the Google Analytics account. If the FirebaseProject already has Google Analytics enabled, and you call AddGoogleAnalytics using an analyticsPropertyId that's different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifying timeZone and regionCode in the call to AddFirebase . |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
projectsId | string |
INSERT
examples
- add_google_analytics
- Manifest
Links the specified FirebaseProject with an existing Google Analytics account. Using this call, you can either: - Specify an analyticsAccountId
to provision a new Google Analytics property within the specified account and associate the new property with the FirebaseProject
. - Specify an existing analyticsPropertyId
to associate the property with the FirebaseProject
. Note that when you call AddGoogleAnalytics
: 1. The first check determines if any existing data streams in the Google Analytics property correspond to any existing Firebase Apps in the FirebaseProject
(based on the packageName
or bundleId
associated with the data stream). Then, as applicable, the data streams and apps are linked. Note that this auto-linking only applies to AndroidApps
and IosApps
. 2. If no corresponding data streams are found for the Firebase Apps, new data streams are provisioned in the Google Analytics property for each of the Firebase Apps. Note that a new data stream is always provisioned for a Web App even if it was previously associated with a data stream in the Analytics property. Learn more about the hierarchy and structure of Google Analytics accounts in the Analytics documentation. The result of this call is an Operation
. Poll the Operation
to track the provisioning process by calling GetOperation until done
is true
. When done
is true
, the Operation
has either succeeded or failed. If the Operation
succeeded, its response
is set to an AnalyticsDetails; if the Operation
failed, its error
is set to a google.rpc.Status. To call AddGoogleAnalytics
, a project member must be an Owner for the existing FirebaseProject
and have the Edit
permission for the Google Analytics account. If the FirebaseProject
already has Google Analytics enabled, and you call AddGoogleAnalytics
using an analyticsPropertyId
that's different from the currently associated property, then the call will fail. Analytics may have already been enabled in the Firebase console or by specifying timeZone
and regionCode
in the call to AddFirebase
.
INSERT INTO firebase.firebase.google_analytics (
data__analyticsAccountId,
data__analyticsPropertyId,
projectsId
)
SELECT
'{{ analyticsAccountId }}',
'{{ analyticsPropertyId }}',
'{{ projectsId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: google_analytics
props:
- name: projectsId
value: string
description: Required parameter for the google_analytics resource.
- name: analyticsAccountId
value: string
description: >
The ID for the existing [Google Analytics account](http://www.google.com/analytics/) that you want to link with the `FirebaseProject`. Specifying this field will provision a new Google Analytics property in your Google Analytics account and associate the new property with the `FirebaseProject`.
- name: analyticsPropertyId
value: string
description: >
The ID for the existing Google Analytics property that you want to associate with the `FirebaseProject`.