All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.brsanthu.googleanalytics.request.SocialHit Maven / Gradle / Ivy

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.brsanthu.googleanalytics.request;

import static com.brsanthu.googleanalytics.internal.Constants.HIT_SOCIAL;
import static com.brsanthu.googleanalytics.request.GoogleAnalyticsParameter.SOCIAL_ACTION;
import static com.brsanthu.googleanalytics.request.GoogleAnalyticsParameter.SOCIAL_ACTION_TARGET;
import static com.brsanthu.googleanalytics.request.GoogleAnalyticsParameter.SOCIAL_NETWORK;

/**
 * GA request to track social interactions
 *
 * 

* For more information, see * GA Parameters * Reference *

* * @author Santhosh Kumar */ public class SocialHit extends GoogleAnalyticsRequest { public SocialHit() { this(null, null, null); } public SocialHit(String socialNetwork, String socialAction, String socialTarget) { super(HIT_SOCIAL); socialAction(socialAction); socialNetwork(socialNetwork); socialActionTarget(socialTarget); } /** *
*

* Required for social hit type. *

*

* Specifies the social network, for example Facebook or Google Plus. *

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
sntextNone50 Bytessocial
*
Example value: facebook
* Example usage: sn=facebook
*/ public SocialHit socialNetwork(String value) { setString(SOCIAL_NETWORK, value); return this; } public String socialNetwork() { return getString(SOCIAL_NETWORK); } /** *
*

* Required for social hit type. *

*

* Specifies the social interaction action. For example on Google Plus when a user clicks the +1 button, the social * action is 'plus'. *

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
satextNone50 Bytessocial
*
Example value: like
* Example usage: sa=like
*/ public SocialHit socialAction(String value) { setString(SOCIAL_ACTION, value); return this; } public String socialAction() { return getString(SOCIAL_ACTION); } /** *
*

* Required for social hit type. *

*

* Specifies the target of a social interaction. This value is typically a URL but can be any text. *

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
sttextNone2048 Bytessocial
*
Example value: http://foo.com
* Example usage: st=http%3A%2F%2Ffoo.com
*/ public SocialHit socialActionTarget(String value) { setString(SOCIAL_ACTION_TARGET, value); return this; } public String socialActionTarget() { return getString(SOCIAL_ACTION_TARGET); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy