Class GoogleAnalyticsDataPublisher
- java.lang.Object
-
- org.wso2.carbon.ganalytics.publisher.GoogleAnalyticsDataPublisher
-
public class GoogleAnalyticsDataPublisher extends Object
This class is responsible for publishing analytics data using the Measurement Protocol. Please refer: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
-
-
Constructor Summary
Constructors Constructor Description GoogleAnalyticsDataPublisher()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<org.apache.http.NameValuePair>
buildPayload(Object o)
Use this method to retireve a payload a list of NameValuePair.static String
buildPayloadString(Object o)
Use this method to retrieve a payload as string.static boolean
publishGET(String payload, String userAgent, boolean useSSL)
Use this method to publish using GET.static boolean
publishPOST(List<org.apache.http.NameValuePair> payload, String userAgent, boolean useSSL)
Use this method to publish using POST.
-
-
-
Method Detail
-
publishPOST
public static boolean publishPOST(List<org.apache.http.NameValuePair> payload, String userAgent, boolean useSSL)
Use this method to publish using POST.- Parameters:
payload
- - use the buildPayload method to retrieve NameValuePair to use as payload here.userAgent
- - set the userAgent - this can be overridden if userAgentOverride (ua) is set in payloaduseSSL
- - to publish using HTTPS, set this value to true.- Returns:
-
publishGET
public static boolean publishGET(String payload, String userAgent, boolean useSSL)
Use this method to publish using GET.- Parameters:
payload
- - use the buildPayloadString method to retrieve query param string to pass as payload here.userAgent
- - set the userAgent - this can be overridden by usinguseSSL
- - to publish using HTTPS, set this value to true.- Returns:
-
buildPayloadString
public static String buildPayloadString(Object o)
Use this method to retrieve a payload as string.- Parameters:
o
- a GoogleAnalyticsData object- Returns:
- query param string
-
-