Skip to content

Commit 4f77477

Browse files
fmontesclaude
andcommitted
rename viewtool from $analytics to $googleanalytics
Avoids potential naming conflicts with other analytics tools by using a more specific viewtool key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8aa51b2 commit 4f77477

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Before submitting a PR, verify:
136136
- [ ] Plugin builds without errors: `./gradlew clean jar`
137137
- [ ] JAR uploads successfully to dotCMS
138138
- [ ] OSGi bundle starts without errors (check logs for "Starting Google Analytics OSGI plugin")
139-
- [ ] Viewtool is available in Velocity (`$analytics`)
139+
- [ ] Viewtool is available in Velocity (`$googleanalytics`)
140140
- [ ] Can create analytics request and query GA4 data
141141
- [ ] No breaking changes to existing Velocity code (or documented if necessary)
142142
- [ ] Works with dotCMS 23.01.10 and newer

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OSGi plugin that integrates Google Analytics 4 (GA4) Data API with dotCMS, enabl
66

77
## What It Does
88

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.
1010

1111
**Note:** This plugin *fetches* analytics data from Google Analytics. It does NOT add tracking code to your site.
1212

@@ -46,14 +46,14 @@ This plugin provides a `$analytics` viewtool in Velocity templates for querying
4646
#set($propertyId = "123456789")
4747
4848
## Create and configure request
49-
#set($gaRequest = $analytics.createAnalyticsRequest($propertyId))
49+
#set($gaRequest = $googleanalytics.createAnalyticsRequest($propertyId))
5050
$gaRequest.setStartDate("2026-02-09")
5151
$gaRequest.setEndDate("2026-02-16")
5252
$gaRequest.setMetrics("sessions,activeUsers")
5353
$gaRequest.setDimensions("date")
5454
5555
## Execute query
56-
#set($gaResponse = $analytics.query($gaRequest))
56+
#set($gaResponse = $googleanalytics.query($gaRequest))
5757
5858
## Display results
5959
<table>

src/main/java/com/dotcms/google/analytics/view/AnalyticsToolInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class AnalyticsToolInfo extends ServletToolInfo {
1111

1212
@Override
1313
public final String getKey() {
14-
return "analytics";
14+
return "googleanalytics";
1515
}
1616

1717
@Override

0 commit comments

Comments
 (0)