Skip to content

Commit

Permalink
feat: add runFunnelReport method to the Alpha version of the Data A…
Browse files Browse the repository at this point in the history
…PI (#208)

* feat: add `runFunnelReport` method to the Alpha version of the Data API

PiperOrigin-RevId: 446813357

Source-Link: googleapis/googleapis@6d3ae1a

Source-Link: googleapis/googleapis-gen@1cfc0eb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWNmYzBlYjY2ODc0ZjA1YzQxODJkNDIyZTFjODliZDVlMmYyYWJlNyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored May 10, 2022
1 parent 099aac8 commit c85c683
Show file tree
Hide file tree
Showing 12 changed files with 47,852 additions and 45,470 deletions.

Large diffs are not rendered by default.

1,333 changes: 885 additions & 448 deletions packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto

Large diffs are not rendered by default.

20,191 changes: 10,590 additions & 9,601 deletions packages/google-analytics-data/protos/protos.d.ts

Large diffs are not rendered by default.

62,673 changes: 32,365 additions & 30,308 deletions packages/google-analytics-data/protos/protos.js

Large diffs are not rendered by default.

6,971 changes: 3,553 additions & 3,418 deletions packages/google-analytics-data/protos/protos.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main() {
// [START analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A Google Analytics GA4 property identifier whose events are tracked.
* Specified in the URL path and not the body. To learn more, see where to
* find your Property
* ID (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id).
* Within a batch request, this property should either be unspecified or
* consistent with the batch-level property.
* Example: properties/1234
*/
// const property = 'abc123'
/**
* Date ranges of data to read. If multiple date ranges are requested, each
* response row will contain a zero based date range index. If two date
* ranges overlap, the event data for the overlapping days is included in the
* response rows for both date ranges.
*/
// const dateRanges = 1234
/**
* The configuration of this request's funnel. This funnel configuration is
* required.
*/
// const funnel = {}
/**
* If specified, this breakdown adds a dimension to the funnel table sub
* report response. This breakdown dimension expands each funnel step to the
* unique values of the breakdown dimension. For example, a breakdown by the
* `deviceCategory` dimension will create rows for `mobile`, `tablet`,
* `desktop`, and the total.
*/
// const funnelBreakdown = {}
/**
* If specified, next action adds a dimension to the funnel visualization sub
* report response. This next action dimension expands each funnel step to the
* unique values of the next action. For example a breakdown by the
* `eventName` dimension will create rows for several events (i.e.
* `session_start` & `click`) and the total.
*/
// const funnelNextAction = {}
/**
* The funnel visualization type controls the dimensions present in the funnel
* visualization sub report response. If not specified, `STANDARD_FUNNEL` is
* used.
*/
// const funnelVisualizationType = {}
/**
* The configurations of segments. Segments are subsets of a property's data.
* In a funnel report with segments, the funnel is evaluated in each segment.
* Each segment specified in this request
* produces a separate row in the response; in the response, each segment
* identified by its name.
* The segments parameter is optional. Requests are limited to 4 segments.
*/
// const segments = 1234
/**
* The number of rows to return. If unspecified, 10,000 rows are returned. The
* API returns a maximum of 100,000 rows per request, no matter how many you
* ask for. `limit` must be positive.
* The API can also return fewer rows than the requested `limit`, if there
* aren't as many dimension values as the `limit`.
*/
// const limit = 1234
/**
* Dimension filters allow you to ask for only specific dimension values in
* the report. To learn more, see Creating a Report: Dimension
* Filters (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters)
* for examples. Metrics cannot be used in this filter.
*/
// const dimensionFilter = {}
/**
* Toggles whether to return the current state of this Analytics Property's
* quota. Quota is returned in PropertyQuota (#PropertyQuota).
*/
// const returnPropertyQuota = true

// Imports the Data library
const {AlphaAnalyticsDataClient} = require('@google-cloud/data').v1alpha;

// Instantiates a client
const dataClient = new AlphaAnalyticsDataClient();

async function callRunFunnelReport() {
// Construct request
const request = {
};

// Run request
const response = await dataClient.runFunnelReport(request);
console.log(response);
}

callRunFunnelReport();
// [END analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"clientLibrary": {
"name": "nodejs-data",
"version": "2.8.0",
"language": "TYPESCRIPT",
"apis": [
{
"id": "google.analytics.data.v1alpha",
"version": "v1alpha"
}
]
},
"snippets": [
{
"regionTag": "analyticsdata_v1alpha_generated_AlphaAnalyticsData_RunFunnelReport_async",
"title": "AlphaAnalyticsData runFunnelReport Sample",
"origin": "API_DEFINITION",
"description": " Returns a customized funnel report of your Google Analytics event data. The data returned from the API is as a table with columns for the requested dimensions and metrics. Funnel exploration lets you visualize the steps your users take to complete a task and quickly see how well they are succeeding or failing at each step. For example, how do prospects become shoppers and then become buyers? How do one time buyers become repeat buyers? With this information, you can improve inefficient or abandoned customer journeys. To learn more, see [GA4 Funnel Explorations](https://support.google.com/analytics/answer/9327974).",
"canonical": true,
"file": "alpha_analytics_data.run_funnel_report.js",
"language": "JAVASCRIPT",
"segments": [
{
"start": 25,
"end": 118,
"type": "FULL"
}
],
"clientMethod": {
"shortName": "RunFunnelReport",
"fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport",
"async": true,
"parameters": [
{
"name": "property",
"type": "TYPE_STRING"
},
{
"name": "date_ranges",
"type": "TYPE_MESSAGE[]"
},
{
"name": "funnel",
"type": ".google.analytics.data.v1alpha.Funnel"
},
{
"name": "funnel_breakdown",
"type": ".google.analytics.data.v1alpha.FunnelBreakdown"
},
{
"name": "funnel_next_action",
"type": ".google.analytics.data.v1alpha.FunnelNextAction"
},
{
"name": "funnel_visualization_type",
"type": ".google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType"
},
{
"name": "segments",
"type": "TYPE_MESSAGE[]"
},
{
"name": "limit",
"type": "TYPE_INT64"
},
{
"name": "dimension_filter",
"type": ".google.analytics.data.v1alpha.FilterExpression"
},
{
"name": "return_property_quota",
"type": "TYPE_BOOL"
}
],
"resultType": ".google.analytics.data.v1alpha.RunFunnelReportResponse",
"client": {
"shortName": "AlphaAnalyticsDataClient",
"fullName": "google.analytics.data.v1alpha.AlphaAnalyticsDataClient"
},
"method": {
"shortName": "RunFunnelReport",
"fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData.RunFunnelReport",
"service": {
"shortName": "AlphaAnalyticsData",
"fullName": "google.analytics.data.v1alpha.AlphaAnalyticsData"
}
}
}
}
]
}
Loading

0 comments on commit c85c683

Please sign in to comment.