You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+90-8Lines changed: 90 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ OSGi plugin that integrates Google Analytics 4 (GA4) Data API with dotCMS, enabl
6
6
7
7
## What It Does
8
8
9
-
This plugin provides a `$analytics` viewtool in Velocity templates for querying Google Analytics 4 data directly from your dotCMS pages. Retrieve metrics like sessions, active users, page views, and more—filtered by dimensions like date, page path, device category, etc.
9
+
This plugin provides a `$googleanalytics` viewtool in Velocity templates for querying Google Analytics 4 data directly from your dotCMS pages. Retrieve metrics like sessions, active users, page views, and more—filtered by dimensions like date, page path, device category, etc.
10
10
11
11
**Note:** This plugin *fetches* analytics data from Google Analytics. It does NOT add tracking code to your site.
12
12
@@ -46,14 +46,14 @@ This plugin provides a `$analytics` viewtool in Velocity templates for querying
Metrics are the numerical measurements you want to analyze:
161
+
-`sessions` - Number of sessions (visits)
93
162
-`activeUsers` - Number of distinct users
94
-
-`screenPageViews` - Total page and screen views
163
+
-`screenPageViews` - Total page views
95
164
-`bounceRate` - Percentage of single-page sessions
96
165
-`averageSessionDuration` - Average session duration in seconds
97
166
98
-
See the [GA4 API Schema](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema) for the full list.
167
+
### Example Query
168
+
169
+
"Show me sessions and active users, broken down by date and page path"
170
+
171
+
```json
172
+
{
173
+
"dimensions": ["date", "pagePath"],
174
+
"metrics": ["sessions", "activeUsers"]
175
+
}
176
+
```
177
+
178
+
Each row in the response represents one unique combination of dimension values with its associated metrics.
179
+
180
+
See the [GA4 API Schema](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema) for the complete list of available dimensions and metrics.
0 commit comments