@googleapis/analyticsdata 2.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1beta.ts CHANGED
@@ -1387,6 +1387,64 @@ export namespace analyticsdata_v1beta {
1387
1387
 
1388
1388
  /**
1389
1389
  * Returns multiple pivot reports in a batch. All reports must be for the same Google Analytics property.
1390
+ * @example
1391
+ * ```js
1392
+ * // Before running the sample:
1393
+ * // - Enable the API at:
1394
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
1395
+ * // - Login into gcloud by running:
1396
+ * // ```sh
1397
+ * // $ gcloud auth application-default login
1398
+ * // ```
1399
+ * // - Install the npm module by running:
1400
+ * // ```sh
1401
+ * // $ npm install googleapis
1402
+ * // ```
1403
+ *
1404
+ * const {google} = require('googleapis');
1405
+ * const analyticsdata = google.analyticsdata('v1beta');
1406
+ *
1407
+ * async function main() {
1408
+ * const auth = new google.auth.GoogleAuth({
1409
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1410
+ * scopes: [
1411
+ * 'https://www.googleapis.com/auth/analytics',
1412
+ * 'https://www.googleapis.com/auth/analytics.readonly',
1413
+ * ],
1414
+ * });
1415
+ *
1416
+ * // Acquire an auth client, and bind it to all future calls
1417
+ * const authClient = await auth.getClient();
1418
+ * google.options({auth: authClient});
1419
+ *
1420
+ * // Do the magic
1421
+ * const res = await analyticsdata.properties.batchRunPivotReports({
1422
+ * // A Google Analytics 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). This property must be specified for the batch. The property within RunPivotReportRequest may either be unspecified or consistent with this property. Example: properties/1234
1423
+ * property: 'properties/my-propertie',
1424
+ *
1425
+ * // Request body metadata
1426
+ * requestBody: {
1427
+ * // request body parameters
1428
+ * // {
1429
+ * // "requests": []
1430
+ * // }
1431
+ * },
1432
+ * });
1433
+ * console.log(res.data);
1434
+ *
1435
+ * // Example response
1436
+ * // {
1437
+ * // "kind": "my_kind",
1438
+ * // "pivotReports": []
1439
+ * // }
1440
+ * }
1441
+ *
1442
+ * main().catch(e => {
1443
+ * console.error(e);
1444
+ * throw e;
1445
+ * });
1446
+ *
1447
+ * ```
1390
1448
  *
1391
1449
  * @param params - Parameters for request
1392
1450
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1485,6 +1543,64 @@ export namespace analyticsdata_v1beta {
1485
1543
 
1486
1544
  /**
1487
1545
  * Returns multiple reports in a batch. All reports must be for the same Google Analytics property.
1546
+ * @example
1547
+ * ```js
1548
+ * // Before running the sample:
1549
+ * // - Enable the API at:
1550
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
1551
+ * // - Login into gcloud by running:
1552
+ * // ```sh
1553
+ * // $ gcloud auth application-default login
1554
+ * // ```
1555
+ * // - Install the npm module by running:
1556
+ * // ```sh
1557
+ * // $ npm install googleapis
1558
+ * // ```
1559
+ *
1560
+ * const {google} = require('googleapis');
1561
+ * const analyticsdata = google.analyticsdata('v1beta');
1562
+ *
1563
+ * async function main() {
1564
+ * const auth = new google.auth.GoogleAuth({
1565
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1566
+ * scopes: [
1567
+ * 'https://www.googleapis.com/auth/analytics',
1568
+ * 'https://www.googleapis.com/auth/analytics.readonly',
1569
+ * ],
1570
+ * });
1571
+ *
1572
+ * // Acquire an auth client, and bind it to all future calls
1573
+ * const authClient = await auth.getClient();
1574
+ * google.options({auth: authClient});
1575
+ *
1576
+ * // Do the magic
1577
+ * const res = await analyticsdata.properties.batchRunReports({
1578
+ * // A Google Analytics 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). This property must be specified for the batch. The property within RunReportRequest may either be unspecified or consistent with this property. Example: properties/1234
1579
+ * property: 'properties/my-propertie',
1580
+ *
1581
+ * // Request body metadata
1582
+ * requestBody: {
1583
+ * // request body parameters
1584
+ * // {
1585
+ * // "requests": []
1586
+ * // }
1587
+ * },
1588
+ * });
1589
+ * console.log(res.data);
1590
+ *
1591
+ * // Example response
1592
+ * // {
1593
+ * // "kind": "my_kind",
1594
+ * // "reports": []
1595
+ * // }
1596
+ * }
1597
+ *
1598
+ * main().catch(e => {
1599
+ * console.error(e);
1600
+ * throw e;
1601
+ * });
1602
+ *
1603
+ * ```
1488
1604
  *
1489
1605
  * @param params - Parameters for request
1490
1606
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1581,6 +1697,68 @@ export namespace analyticsdata_v1beta {
1581
1697
 
1582
1698
  /**
1583
1699
  * This compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dimensions and metrics are incompatible. In Google Analytics, reports fail if they request incompatible dimensions and/or metrics; in that case, you will need to remove dimensions and/or metrics from the incompatible report until the report is compatible. The Realtime and Core reports have different compatibility rules. This method checks compatibility for Core reports.
1700
+ * @example
1701
+ * ```js
1702
+ * // Before running the sample:
1703
+ * // - Enable the API at:
1704
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
1705
+ * // - Login into gcloud by running:
1706
+ * // ```sh
1707
+ * // $ gcloud auth application-default login
1708
+ * // ```
1709
+ * // - Install the npm module by running:
1710
+ * // ```sh
1711
+ * // $ npm install googleapis
1712
+ * // ```
1713
+ *
1714
+ * const {google} = require('googleapis');
1715
+ * const analyticsdata = google.analyticsdata('v1beta');
1716
+ *
1717
+ * async function main() {
1718
+ * const auth = new google.auth.GoogleAuth({
1719
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1720
+ * scopes: [
1721
+ * 'https://www.googleapis.com/auth/analytics',
1722
+ * 'https://www.googleapis.com/auth/analytics.readonly',
1723
+ * ],
1724
+ * });
1725
+ *
1726
+ * // Acquire an auth client, and bind it to all future calls
1727
+ * const authClient = await auth.getClient();
1728
+ * google.options({auth: authClient});
1729
+ *
1730
+ * // Do the magic
1731
+ * const res = await analyticsdata.properties.checkCompatibility({
1732
+ * // A Google Analytics property identifier whose events are tracked. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). `property` should be the same value as in your `runReport` request. Example: properties/1234
1733
+ * property: 'properties/my-propertie',
1734
+ *
1735
+ * // Request body metadata
1736
+ * requestBody: {
1737
+ * // request body parameters
1738
+ * // {
1739
+ * // "compatibilityFilter": "my_compatibilityFilter",
1740
+ * // "dimensionFilter": {},
1741
+ * // "dimensions": [],
1742
+ * // "metricFilter": {},
1743
+ * // "metrics": []
1744
+ * // }
1745
+ * },
1746
+ * });
1747
+ * console.log(res.data);
1748
+ *
1749
+ * // Example response
1750
+ * // {
1751
+ * // "dimensionCompatibilities": [],
1752
+ * // "metricCompatibilities": []
1753
+ * // }
1754
+ * }
1755
+ *
1756
+ * main().catch(e => {
1757
+ * console.error(e);
1758
+ * throw e;
1759
+ * });
1760
+ *
1761
+ * ```
1584
1762
  *
1585
1763
  * @param params - Parameters for request
1586
1764
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1677,6 +1855,58 @@ export namespace analyticsdata_v1beta {
1677
1855
 
1678
1856
  /**
1679
1857
  * Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics property identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.
1858
+ * @example
1859
+ * ```js
1860
+ * // Before running the sample:
1861
+ * // - Enable the API at:
1862
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
1863
+ * // - Login into gcloud by running:
1864
+ * // ```sh
1865
+ * // $ gcloud auth application-default login
1866
+ * // ```
1867
+ * // - Install the npm module by running:
1868
+ * // ```sh
1869
+ * // $ npm install googleapis
1870
+ * // ```
1871
+ *
1872
+ * const {google} = require('googleapis');
1873
+ * const analyticsdata = google.analyticsdata('v1beta');
1874
+ *
1875
+ * async function main() {
1876
+ * const auth = new google.auth.GoogleAuth({
1877
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1878
+ * scopes: [
1879
+ * 'https://www.googleapis.com/auth/analytics',
1880
+ * 'https://www.googleapis.com/auth/analytics.readonly',
1881
+ * ],
1882
+ * });
1883
+ *
1884
+ * // Acquire an auth client, and bind it to all future calls
1885
+ * const authClient = await auth.getClient();
1886
+ * google.options({auth: authClient});
1887
+ *
1888
+ * // Do the magic
1889
+ * const res = await analyticsdata.properties.getMetadata({
1890
+ * // Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.
1891
+ * name: 'properties/my-propertie/metadata',
1892
+ * });
1893
+ * console.log(res.data);
1894
+ *
1895
+ * // Example response
1896
+ * // {
1897
+ * // "comparisons": [],
1898
+ * // "dimensions": [],
1899
+ * // "metrics": [],
1900
+ * // "name": "my_name"
1901
+ * // }
1902
+ * }
1903
+ *
1904
+ * main().catch(e => {
1905
+ * console.error(e);
1906
+ * throw e;
1907
+ * });
1908
+ *
1909
+ * ```
1680
1910
  *
1681
1911
  * @param params - Parameters for request
1682
1912
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1766,6 +1996,81 @@ export namespace analyticsdata_v1beta {
1766
1996
 
1767
1997
  /**
1768
1998
  * Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.
1999
+ * @example
2000
+ * ```js
2001
+ * // Before running the sample:
2002
+ * // - Enable the API at:
2003
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2004
+ * // - Login into gcloud by running:
2005
+ * // ```sh
2006
+ * // $ gcloud auth application-default login
2007
+ * // ```
2008
+ * // - Install the npm module by running:
2009
+ * // ```sh
2010
+ * // $ npm install googleapis
2011
+ * // ```
2012
+ *
2013
+ * const {google} = require('googleapis');
2014
+ * const analyticsdata = google.analyticsdata('v1beta');
2015
+ *
2016
+ * async function main() {
2017
+ * const auth = new google.auth.GoogleAuth({
2018
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2019
+ * scopes: [
2020
+ * 'https://www.googleapis.com/auth/analytics',
2021
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2022
+ * ],
2023
+ * });
2024
+ *
2025
+ * // Acquire an auth client, and bind it to all future calls
2026
+ * const authClient = await auth.getClient();
2027
+ * google.options({auth: authClient});
2028
+ *
2029
+ * // Do the magic
2030
+ * const res = await analyticsdata.properties.runPivotReport({
2031
+ * // A Google Analytics 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
2032
+ * property: 'properties/my-propertie',
2033
+ *
2034
+ * // Request body metadata
2035
+ * requestBody: {
2036
+ * // request body parameters
2037
+ * // {
2038
+ * // "cohortSpec": {},
2039
+ * // "comparisons": [],
2040
+ * // "currencyCode": "my_currencyCode",
2041
+ * // "dateRanges": [],
2042
+ * // "dimensionFilter": {},
2043
+ * // "dimensions": [],
2044
+ * // "keepEmptyRows": false,
2045
+ * // "metricFilter": {},
2046
+ * // "metrics": [],
2047
+ * // "pivots": [],
2048
+ * // "property": "my_property",
2049
+ * // "returnPropertyQuota": false
2050
+ * // }
2051
+ * },
2052
+ * });
2053
+ * console.log(res.data);
2054
+ *
2055
+ * // Example response
2056
+ * // {
2057
+ * // "aggregates": [],
2058
+ * // "dimensionHeaders": [],
2059
+ * // "kind": "my_kind",
2060
+ * // "metadata": {},
2061
+ * // "metricHeaders": [],
2062
+ * // "pivotHeaders": [],
2063
+ * // "propertyQuota": {},
2064
+ * // "rows": []
2065
+ * // }
2066
+ * }
2067
+ *
2068
+ * main().catch(e => {
2069
+ * console.error(e);
2070
+ * throw e;
2071
+ * });
2072
+ *
2073
+ * ```
1769
2074
  *
1770
2075
  * @param params - Parameters for request
1771
2076
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1862,6 +2167,79 @@ export namespace analyticsdata_v1beta {
1862
2167
 
1863
2168
  /**
1864
2169
  * Returns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytics. Realtime reports show events and usage data for the periods of time ranging from the present moment to 30 minutes ago (up to 60 minutes for Google Analytics 360 properties). For a guide to constructing realtime requests & understanding responses, see [Creating a Realtime Report](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-basics).
2170
+ * @example
2171
+ * ```js
2172
+ * // Before running the sample:
2173
+ * // - Enable the API at:
2174
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2175
+ * // - Login into gcloud by running:
2176
+ * // ```sh
2177
+ * // $ gcloud auth application-default login
2178
+ * // ```
2179
+ * // - Install the npm module by running:
2180
+ * // ```sh
2181
+ * // $ npm install googleapis
2182
+ * // ```
2183
+ *
2184
+ * const {google} = require('googleapis');
2185
+ * const analyticsdata = google.analyticsdata('v1beta');
2186
+ *
2187
+ * async function main() {
2188
+ * const auth = new google.auth.GoogleAuth({
2189
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2190
+ * scopes: [
2191
+ * 'https://www.googleapis.com/auth/analytics',
2192
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2193
+ * ],
2194
+ * });
2195
+ *
2196
+ * // Acquire an auth client, and bind it to all future calls
2197
+ * const authClient = await auth.getClient();
2198
+ * google.options({auth: authClient});
2199
+ *
2200
+ * // Do the magic
2201
+ * const res = await analyticsdata.properties.runRealtimeReport({
2202
+ * // A Google Analytics 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). Example: properties/1234
2203
+ * property: 'properties/my-propertie',
2204
+ *
2205
+ * // Request body metadata
2206
+ * requestBody: {
2207
+ * // request body parameters
2208
+ * // {
2209
+ * // "dimensionFilter": {},
2210
+ * // "dimensions": [],
2211
+ * // "limit": "my_limit",
2212
+ * // "metricAggregations": [],
2213
+ * // "metricFilter": {},
2214
+ * // "metrics": [],
2215
+ * // "minuteRanges": [],
2216
+ * // "orderBys": [],
2217
+ * // "returnPropertyQuota": false
2218
+ * // }
2219
+ * },
2220
+ * });
2221
+ * console.log(res.data);
2222
+ *
2223
+ * // Example response
2224
+ * // {
2225
+ * // "dimensionHeaders": [],
2226
+ * // "kind": "my_kind",
2227
+ * // "maximums": [],
2228
+ * // "metricHeaders": [],
2229
+ * // "minimums": [],
2230
+ * // "propertyQuota": {},
2231
+ * // "rowCount": 0,
2232
+ * // "rows": [],
2233
+ * // "totals": []
2234
+ * // }
2235
+ * }
2236
+ *
2237
+ * main().catch(e => {
2238
+ * console.error(e);
2239
+ * throw e;
2240
+ * });
2241
+ *
2242
+ * ```
1865
2243
  *
1866
2244
  * @param params - Parameters for request
1867
2245
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1958,6 +2336,86 @@ export namespace analyticsdata_v1beta {
1958
2336
 
1959
2337
  /**
1960
2338
  * Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name. For a guide to constructing requests & understanding responses, see [Creating a Report](https://developers.google.com/analytics/devguides/reporting/data/v1/basics).
2339
+ * @example
2340
+ * ```js
2341
+ * // Before running the sample:
2342
+ * // - Enable the API at:
2343
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2344
+ * // - Login into gcloud by running:
2345
+ * // ```sh
2346
+ * // $ gcloud auth application-default login
2347
+ * // ```
2348
+ * // - Install the npm module by running:
2349
+ * // ```sh
2350
+ * // $ npm install googleapis
2351
+ * // ```
2352
+ *
2353
+ * const {google} = require('googleapis');
2354
+ * const analyticsdata = google.analyticsdata('v1beta');
2355
+ *
2356
+ * async function main() {
2357
+ * const auth = new google.auth.GoogleAuth({
2358
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2359
+ * scopes: [
2360
+ * 'https://www.googleapis.com/auth/analytics',
2361
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2362
+ * ],
2363
+ * });
2364
+ *
2365
+ * // Acquire an auth client, and bind it to all future calls
2366
+ * const authClient = await auth.getClient();
2367
+ * google.options({auth: authClient});
2368
+ *
2369
+ * // Do the magic
2370
+ * const res = await analyticsdata.properties.runReport({
2371
+ * // A Google Analytics 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
2372
+ * property: 'properties/my-propertie',
2373
+ *
2374
+ * // Request body metadata
2375
+ * requestBody: {
2376
+ * // request body parameters
2377
+ * // {
2378
+ * // "cohortSpec": {},
2379
+ * // "comparisons": [],
2380
+ * // "currencyCode": "my_currencyCode",
2381
+ * // "dateRanges": [],
2382
+ * // "dimensionFilter": {},
2383
+ * // "dimensions": [],
2384
+ * // "keepEmptyRows": false,
2385
+ * // "limit": "my_limit",
2386
+ * // "metricAggregations": [],
2387
+ * // "metricFilter": {},
2388
+ * // "metrics": [],
2389
+ * // "offset": "my_offset",
2390
+ * // "orderBys": [],
2391
+ * // "property": "my_property",
2392
+ * // "returnPropertyQuota": false
2393
+ * // }
2394
+ * },
2395
+ * });
2396
+ * console.log(res.data);
2397
+ *
2398
+ * // Example response
2399
+ * // {
2400
+ * // "dimensionHeaders": [],
2401
+ * // "kind": "my_kind",
2402
+ * // "maximums": [],
2403
+ * // "metadata": {},
2404
+ * // "metricHeaders": [],
2405
+ * // "minimums": [],
2406
+ * // "propertyQuota": {},
2407
+ * // "rowCount": 0,
2408
+ * // "rows": [],
2409
+ * // "totals": []
2410
+ * // }
2411
+ * }
2412
+ *
2413
+ * main().catch(e => {
2414
+ * console.error(e);
2415
+ * throw e;
2416
+ * });
2417
+ *
2418
+ * ```
1961
2419
  *
1962
2420
  * @param params - Parameters for request
1963
2421
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2137,6 +2595,76 @@ export namespace analyticsdata_v1beta {
2137
2595
 
2138
2596
  /**
2139
2597
  * Creates an audience export for later retrieval. This method quickly returns the audience export's resource name and initiates a long running asynchronous request to form an audience export. To export the users in an audience export, first create the audience export through this method and then send the audience resource name to the `QueryAudienceExport` method. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. An audience export is a snapshot of the users currently in the audience at the time of audience export creation. Creating audience exports for one audience on different days will return different results as users enter and exit the audience. Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience exports contain the users in each audience. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
2598
+ * @example
2599
+ * ```js
2600
+ * // Before running the sample:
2601
+ * // - Enable the API at:
2602
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2603
+ * // - Login into gcloud by running:
2604
+ * // ```sh
2605
+ * // $ gcloud auth application-default login
2606
+ * // ```
2607
+ * // - Install the npm module by running:
2608
+ * // ```sh
2609
+ * // $ npm install googleapis
2610
+ * // ```
2611
+ *
2612
+ * const {google} = require('googleapis');
2613
+ * const analyticsdata = google.analyticsdata('v1beta');
2614
+ *
2615
+ * async function main() {
2616
+ * const auth = new google.auth.GoogleAuth({
2617
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2618
+ * scopes: [
2619
+ * 'https://www.googleapis.com/auth/analytics',
2620
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2621
+ * ],
2622
+ * });
2623
+ *
2624
+ * // Acquire an auth client, and bind it to all future calls
2625
+ * const authClient = await auth.getClient();
2626
+ * google.options({auth: authClient});
2627
+ *
2628
+ * // Do the magic
2629
+ * const res = await analyticsdata.properties.audienceExports.create({
2630
+ * // Required. The parent resource where this audience export will be created. Format: `properties/{property\}`
2631
+ * parent: 'properties/my-propertie',
2632
+ *
2633
+ * // Request body metadata
2634
+ * requestBody: {
2635
+ * // request body parameters
2636
+ * // {
2637
+ * // "audience": "my_audience",
2638
+ * // "audienceDisplayName": "my_audienceDisplayName",
2639
+ * // "beginCreatingTime": "my_beginCreatingTime",
2640
+ * // "creationQuotaTokensCharged": 0,
2641
+ * // "dimensions": [],
2642
+ * // "errorMessage": "my_errorMessage",
2643
+ * // "name": "my_name",
2644
+ * // "percentageCompleted": {},
2645
+ * // "rowCount": 0,
2646
+ * // "state": "my_state"
2647
+ * // }
2648
+ * },
2649
+ * });
2650
+ * console.log(res.data);
2651
+ *
2652
+ * // Example response
2653
+ * // {
2654
+ * // "done": false,
2655
+ * // "error": {},
2656
+ * // "metadata": {},
2657
+ * // "name": "my_name",
2658
+ * // "response": {}
2659
+ * // }
2660
+ * }
2661
+ *
2662
+ * main().catch(e => {
2663
+ * console.error(e);
2664
+ * throw e;
2665
+ * });
2666
+ *
2667
+ * ```
2140
2668
  *
2141
2669
  * @param params - Parameters for request
2142
2670
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2229,6 +2757,64 @@ export namespace analyticsdata_v1beta {
2229
2757
 
2230
2758
  /**
2231
2759
  * Gets configuration metadata about a specific audience export. This method can be used to understand an audience export after it has been created. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
2760
+ * @example
2761
+ * ```js
2762
+ * // Before running the sample:
2763
+ * // - Enable the API at:
2764
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2765
+ * // - Login into gcloud by running:
2766
+ * // ```sh
2767
+ * // $ gcloud auth application-default login
2768
+ * // ```
2769
+ * // - Install the npm module by running:
2770
+ * // ```sh
2771
+ * // $ npm install googleapis
2772
+ * // ```
2773
+ *
2774
+ * const {google} = require('googleapis');
2775
+ * const analyticsdata = google.analyticsdata('v1beta');
2776
+ *
2777
+ * async function main() {
2778
+ * const auth = new google.auth.GoogleAuth({
2779
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2780
+ * scopes: [
2781
+ * 'https://www.googleapis.com/auth/analytics',
2782
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2783
+ * ],
2784
+ * });
2785
+ *
2786
+ * // Acquire an auth client, and bind it to all future calls
2787
+ * const authClient = await auth.getClient();
2788
+ * google.options({auth: authClient});
2789
+ *
2790
+ * // Do the magic
2791
+ * const res = await analyticsdata.properties.audienceExports.get({
2792
+ * // Required. The audience export resource name. Format: `properties/{property\}/audienceExports/{audience_export\}`
2793
+ * name: 'properties/my-propertie/audienceExports/my-audienceExport',
2794
+ * });
2795
+ * console.log(res.data);
2796
+ *
2797
+ * // Example response
2798
+ * // {
2799
+ * // "audience": "my_audience",
2800
+ * // "audienceDisplayName": "my_audienceDisplayName",
2801
+ * // "beginCreatingTime": "my_beginCreatingTime",
2802
+ * // "creationQuotaTokensCharged": 0,
2803
+ * // "dimensions": [],
2804
+ * // "errorMessage": "my_errorMessage",
2805
+ * // "name": "my_name",
2806
+ * // "percentageCompleted": {},
2807
+ * // "rowCount": 0,
2808
+ * // "state": "my_state"
2809
+ * // }
2810
+ * }
2811
+ *
2812
+ * main().catch(e => {
2813
+ * console.error(e);
2814
+ * throw e;
2815
+ * });
2816
+ *
2817
+ * ```
2232
2818
  *
2233
2819
  * @param params - Parameters for request
2234
2820
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2318,6 +2904,60 @@ export namespace analyticsdata_v1beta {
2318
2904
 
2319
2905
  /**
2320
2906
  * Lists all audience exports for a property. This method can be used for you to find and reuse existing audience exports rather than creating unnecessary new audience exports. The same audience can have multiple audience exports that represent the export of users that were in an audience on different days. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
2907
+ * @example
2908
+ * ```js
2909
+ * // Before running the sample:
2910
+ * // - Enable the API at:
2911
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
2912
+ * // - Login into gcloud by running:
2913
+ * // ```sh
2914
+ * // $ gcloud auth application-default login
2915
+ * // ```
2916
+ * // - Install the npm module by running:
2917
+ * // ```sh
2918
+ * // $ npm install googleapis
2919
+ * // ```
2920
+ *
2921
+ * const {google} = require('googleapis');
2922
+ * const analyticsdata = google.analyticsdata('v1beta');
2923
+ *
2924
+ * async function main() {
2925
+ * const auth = new google.auth.GoogleAuth({
2926
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2927
+ * scopes: [
2928
+ * 'https://www.googleapis.com/auth/analytics',
2929
+ * 'https://www.googleapis.com/auth/analytics.readonly',
2930
+ * ],
2931
+ * });
2932
+ *
2933
+ * // Acquire an auth client, and bind it to all future calls
2934
+ * const authClient = await auth.getClient();
2935
+ * google.options({auth: authClient});
2936
+ *
2937
+ * // Do the magic
2938
+ * const res = await analyticsdata.properties.audienceExports.list({
2939
+ * // Optional. The maximum number of audience exports to return. The service may return fewer than this value. If unspecified, at most 200 audience exports will be returned. The maximum value is 1000 (higher values will be coerced to the maximum).
2940
+ * pageSize: 'placeholder-value',
2941
+ * // Optional. A page token, received from a previous `ListAudienceExports` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAudienceExports` must match the call that provided the page token.
2942
+ * pageToken: 'placeholder-value',
2943
+ * // Required. All audience exports for this property will be listed in the response. Format: `properties/{property\}`
2944
+ * parent: 'properties/my-propertie',
2945
+ * });
2946
+ * console.log(res.data);
2947
+ *
2948
+ * // Example response
2949
+ * // {
2950
+ * // "audienceExports": [],
2951
+ * // "nextPageToken": "my_nextPageToken"
2952
+ * // }
2953
+ * }
2954
+ *
2955
+ * main().catch(e => {
2956
+ * console.error(e);
2957
+ * throw e;
2958
+ * });
2959
+ *
2960
+ * ```
2321
2961
  *
2322
2962
  * @param params - Parameters for request
2323
2963
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2414,6 +3054,66 @@ export namespace analyticsdata_v1beta {
2414
3054
 
2415
3055
  /**
2416
3056
  * Retrieves an audience export of users. After creating an audience, the users are not immediately available for exporting. First, a request to `CreateAudienceExport` is necessary to create an audience export of users, and then second, this method is used to retrieve the users in the audience export. See [Creating an Audience Export](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-basics) for an introduction to Audience Exports with examples. Audiences in Google Analytics 4 allow you to segment your users in the ways that are important to your business. To learn more, see https://support.google.com/analytics/answer/9267572. Audience Export APIs have some methods at alpha and other methods at beta stability. The intention is to advance methods to beta stability after some feedback and adoption. To give your feedback on this API, complete the [Google Analytics Audience Export API Feedback](https://forms.gle/EeA5u5LW6PEggtCEA) form.
3057
+ * @example
3058
+ * ```js
3059
+ * // Before running the sample:
3060
+ * // - Enable the API at:
3061
+ * // https://console.developers.google.com/apis/api/analyticsdata.googleapis.com
3062
+ * // - Login into gcloud by running:
3063
+ * // ```sh
3064
+ * // $ gcloud auth application-default login
3065
+ * // ```
3066
+ * // - Install the npm module by running:
3067
+ * // ```sh
3068
+ * // $ npm install googleapis
3069
+ * // ```
3070
+ *
3071
+ * const {google} = require('googleapis');
3072
+ * const analyticsdata = google.analyticsdata('v1beta');
3073
+ *
3074
+ * async function main() {
3075
+ * const auth = new google.auth.GoogleAuth({
3076
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3077
+ * scopes: [
3078
+ * 'https://www.googleapis.com/auth/analytics',
3079
+ * 'https://www.googleapis.com/auth/analytics.readonly',
3080
+ * ],
3081
+ * });
3082
+ *
3083
+ * // Acquire an auth client, and bind it to all future calls
3084
+ * const authClient = await auth.getClient();
3085
+ * google.options({auth: authClient});
3086
+ *
3087
+ * // Do the magic
3088
+ * const res = await analyticsdata.properties.audienceExports.query({
3089
+ * // Required. The name of the audience export to retrieve users from. Format: `properties/{property\}/audienceExports/{audience_export\}`
3090
+ * name: 'properties/my-propertie/audienceExports/my-audienceExport',
3091
+ *
3092
+ * // Request body metadata
3093
+ * requestBody: {
3094
+ * // request body parameters
3095
+ * // {
3096
+ * // "limit": "my_limit",
3097
+ * // "offset": "my_offset"
3098
+ * // }
3099
+ * },
3100
+ * });
3101
+ * console.log(res.data);
3102
+ *
3103
+ * // Example response
3104
+ * // {
3105
+ * // "audienceExport": {},
3106
+ * // "audienceRows": [],
3107
+ * // "rowCount": 0
3108
+ * // }
3109
+ * }
3110
+ *
3111
+ * main().catch(e => {
3112
+ * console.error(e);
3113
+ * throw e;
3114
+ * });
3115
+ *
3116
+ * ```
2417
3117
  *
2418
3118
  * @param params - Parameters for request
2419
3119
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.