Package org.dspace.google.client
Class GoogleAnalytics4ClientRequestBuilder
- java.lang.Object
-
- org.dspace.google.client.GoogleAnalytics4ClientRequestBuilder
-
- All Implemented Interfaces:
GoogleAnalyticsClientRequestBuilder
public class GoogleAnalytics4ClientRequestBuilder extends Object implements GoogleAnalyticsClientRequestBuilder
Implementation ofGoogleAnalyticsClientRequestBuilderthat compose the request for Google Analytics 4 (GA4).- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGoogleAnalytics4ClientRequestBuilder.GoogleAnalytics4EventParamsVOClass that model the params of a specific event to be sent to GA.static classGoogleAnalytics4ClientRequestBuilder.GoogleAnalytics4EventsVOClass that models the json of the events to be write in the body of the GA request.static classGoogleAnalytics4ClientRequestBuilder.GoogleAnalytics4EventVOClass that model a single event to be sent to GA.
-
Constructor Summary
Constructors Constructor Description GoogleAnalytics4ClientRequestBuilder(String endpointUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>composeRequestsBody(String analyticsKey, List<GoogleAnalyticsEvent> events)Returns the body of the requests to be sent to Google Analytics as string, based on the given analytics key and events.StringgetEndpointUrl(String analyticsKey)Returns the url of the Google Analytics endpoint.voidsetConfigurationService(ConfigurationService configurationService)
-
-
-
Constructor Detail
-
GoogleAnalytics4ClientRequestBuilder
public GoogleAnalytics4ClientRequestBuilder(String endpointUrl)
-
-
Method Detail
-
getEndpointUrl
public String getEndpointUrl(String analyticsKey)
Description copied from interface:GoogleAnalyticsClientRequestBuilderReturns the url of the Google Analytics endpoint.- Specified by:
getEndpointUrlin interfaceGoogleAnalyticsClientRequestBuilder- Parameters:
analyticsKey- the Google Analytics key- Returns:
- the endpoint url
-
composeRequestsBody
public List<String> composeRequestsBody(String analyticsKey, List<GoogleAnalyticsEvent> events)
Description copied from interface:GoogleAnalyticsClientRequestBuilderReturns the body of the requests to be sent to Google Analytics as string, based on the given analytics key and events.- Specified by:
composeRequestsBodyin interfaceGoogleAnalyticsClientRequestBuilder- Parameters:
analyticsKey- the Google Analytics keyevents- the events to be sent- Returns:
- the requests body as string
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
-