Package com.semanticcms.googleanalytics
Class GoogleAnalytics
java.lang.Object
com.semanticcms.googleanalytics.GoogleAnalytics
- All Implemented Interfaces:
Component
For
Doctype.HTML5
, adds the modern Google Analytics Global Site Tag.
For other doctypes, adds an older-style Google Analytics analytics.js tracking script.
Both are added at ComponentPosition.HEAD_START
.
This is applied to all views
and all pages
, even those that are "noindex".- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Registers theGoogleAnalytics
component inSemanticCMS
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The context parameter name that contains the tracking ID. -
Method Summary
Modifier and TypeMethodDescriptionvoid
doComponent
(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, DocumentEE document, View view, Page page, ComponentPosition position)
-
Field Details
-
TRACKING_ID_INIT_PARAM
The context parameter name that contains the tracking ID.
-
-
Method Details
-
doComponent
public void doComponent(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, DocumentEE document, View view, Page page, ComponentPosition position) throws ServletException, IOException - Specified by:
doComponent
in interfaceComponent
- Throws:
ServletException
IOException
-