@zerodot/google-analytics 0.0.0-stage → 1.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/LICENSE +661 -0
- package/README.md +49 -2
- package/dist/index.cjs +1162 -0
- package/google-analytics.svg +1 -0
- package/package.json +46 -3
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zerodot/google-analytics
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Get reports and user activity from Google Analytics. Connect with Google sign-in.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
In zerodot, go to **System > Nodes** and install **Google Analytics**.
|
|
8
|
+
|
|
9
|
+
Manual: install `@zerodot/google-analytics` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
|
|
10
|
+
|
|
11
|
+
## Nodes
|
|
12
|
+
|
|
13
|
+
### Google Analytics (`google_analytics.api`)
|
|
14
|
+
|
|
15
|
+
- **Report**: get
|
|
16
|
+
- **User Activity**: search
|
|
17
|
+
|
|
18
|
+
#### Report > Get
|
|
19
|
+
|
|
20
|
+
Pick a **Property Type**.
|
|
21
|
+
|
|
22
|
+
- **Google Analytics 4** (default): uses the [Data API](https://developers.google.com/analytics/devguides/reporting/data/v1) `properties/{id}:runReport`. Set the **Property** to the property ID or its URL.
|
|
23
|
+
- **Universal Analytics**: uses the Reporting API v4 `reports:batchGet`. Set the **View** to the view ID or its URL. Google stopped Universal Analytics in 2023, so this mode may not work for new data.
|
|
24
|
+
|
|
25
|
+
Common fields:
|
|
26
|
+
|
|
27
|
+
- **Date Range**: last 7 days (default), last 30 days, today, yesterday, last complete calendar week (Monday to Sunday), last complete calendar month, or custom (**Start** and **End** as `YYYY-MM-DD`).
|
|
28
|
+
- **Metrics** and **Dimensions to split by**: pick from the common list, or choose "Other" and type the API name. A GA4 metric can also be "Custom metric" with an expression (for example `eventCount/totalUsers`). The node refuses a name that appears twice.
|
|
29
|
+
- **Return All** reads all pages. **Limit** (default 50) is the page size when **Return All** is off.
|
|
30
|
+
- **Simplify Output** (default on): one item for each row, with dimension and metric names as keys. Off: the raw answer of Google.
|
|
31
|
+
|
|
32
|
+
Additional fields for GA4: **Currency Code**, **Dimensions Filters** and **Metrics Filters** (an "and" group or an "or" group of string, in list, numeric, and between filters), **Metric Aggregation**, **Keep Empty Rows**, **Order By**, **Return Property Quota**.
|
|
33
|
+
|
|
34
|
+
Additional fields for Universal Analytics (**Additional Fields (Universal Analytics)** in the config): **Dimension Filters**, **Hide Totals**, **Hide Value Ranges**, **Include Empty Rows**, **Use Resource Quotas**.
|
|
35
|
+
|
|
36
|
+
The date ranges use the time zone of the server.
|
|
37
|
+
|
|
38
|
+
#### User Activity > Search
|
|
39
|
+
|
|
40
|
+
Returns the sessions of one user from the Reporting API v4 `userActivity:search`. Set the **View**, the **User ID**, and optional **Activity Types** (Ecommerce, Event, Goal, Pageview, Screenview). **Return All** follows the page token. **Limit** is at most 500.
|
|
41
|
+
|
|
42
|
+
## Credentials
|
|
43
|
+
|
|
44
|
+
- **Google Analytics OAuth2** (`google_analytics.oauth2`): `clientId` and `clientSecret` of a Google Cloud OAuth client. Scope `https://www.googleapis.com/auth/analytics.readonly`. zerodot refreshes the token. The client secret and the tokens are secret.
|
|
45
|
+
|
|
46
|
+
Turn on the Google Analytics Data API (and the Google Analytics Reporting API for Universal Analytics and user activity) in the Google Cloud project.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
AGPL-3.0-only
|