* The event name. To emulate a webpage view use "page_view" and set
* a "page_location" parameter. See
* https://developers.google.com/analytics/devguides/collection/ga4/events?client_type=gtag
* The event name. To emulate a webpage view use "page_view" and set
* a "page_location" parameter. See
* https://developers.google.com/analytics/devguides/collection/ga4/events?client_type=gtag
* @param paramsStrings
* Optional multiple Strings in key, value pairs (there should be an
* even number of paramsStrings) to be set as parameters of the
* event. To emulate a webpage view use "page_location" as the URL in
* a "page_view" event.
*/
* @param paramsStrings
* Optional multiple Strings in key, value pairs (there should be an
* even number of paramsStrings) to be set as parameters of the
* event. To emulate a webpage view use "page_location" as the URL in
* a "page_view" event.
*/
- public void sendAnalytics(String eventName, String... paramsStrings)
+ public void sendAnalytics(String eventName, boolean sendDefaultParams,
+ String... paramsStrings)
Map<String, String> params = new HashMap<>();
// add these to all events from this application instance
Map<String, String> params = new HashMap<>();
// add these to all events from this application instance
// add (and overwrite with) the passed in params
if (paramsStrings != null && paramsStrings.length > 0)
// add (and overwrite with) the passed in params
if (paramsStrings != null && paramsStrings.length > 0)