|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.piwik.SimplePiwikTracker
public class SimplePiwikTracker
Piwik - Open source web analytics Client to record visits, page views, Goals, in a Piwik server. For more information, see http://piwik.org/docs/tracking-api/ released under BSD License http://www.opensource.org/licenses/bsd-license.php
| Field Summary | |
|---|---|
static int |
MAX_CUSTOM_VARIABLE_LENGTH
Maximum length of a custom variable. |
static int |
MAX_CUSTOM_VARIABLES
Maximum number of custom variables. |
static int |
VERSION
|
| Constructor Summary | |
|---|---|
SimplePiwikTracker(int idSite,
String apiUrl,
javax.servlet.http.HttpServletRequest request)
Builds a PiwikTracker object, used to track visits, pages and Goal conversions for a specific website, by using the Piwik Tracking API. |
|
SimplePiwikTracker(String apiUrl)
|
|
| Method Summary | |
|---|---|
void |
clearCustomVariables()
Resets all given custom variables. |
void |
clearPluginList()
Resets all given browser plugins. |
String |
getCustomData()
Getter. |
URL |
getDownloadTrackURL(String downloadurl)
Builds the URL for the download tracking request. |
String |
getGeneralQuery()
Returns the uery part for the url with all parameters from all given informations set to this tracker. |
URL |
getGoalTrackURL(String goal)
|
URL |
getGoalTrackURL(String goal,
String revenue)
|
int |
getIdSite()
Getter. |
String |
getIp()
Getter. |
URL |
getLinkTrackURL(String linkurl)
|
URL |
getPageTrackURL(String pagename)
Builds the URL for the page tracking request. |
String |
getPageUrl()
Getter. |
URL |
getUrlReferrer()
Getter. |
String |
getVisitorCustomData()
|
String |
getVisitorId()
Returns the visitor id of this tracker object. |
void |
readRequestInfos(javax.servlet.http.HttpServletRequest request)
Sets information to the tracker from the request. |
ResponseData |
sendRequest(URL destination)
Sends the request to the PIWIK-Server. |
void |
setAcceptLanguage(Locale locale)
Sets the language set in the browser request. |
void |
setAcceptLanguage(String language)
Sets the language set in the browser request. |
void |
setApiurl(String apiurl)
Sets the url of the piwik installation the tracker will track to. |
void |
setApiurl(URL apiurl)
Sets the url of the piwik installation the tracker will track to. |
void |
setCustomData(String customData)
Sets the custom data. |
void |
setDebugAppendUrl(String debugAppendUrl)
Sets a string for debugging usage. |
void |
setForcedDatetime(Date forcedDatetime)
Sets the time the request was send. |
void |
setIdSite(int idSite)
Sets the site id. |
void |
setIp(String ip)
Sets the ip from which the request was send. |
void |
setLocalTime(Date time)
Sets local visitor time. |
void |
setLocalTime(String time)
Sets local visitor time. |
int |
setPageCustomVariable(String name,
String value)
Sets page custom variables; ignoring fixed order (differs from PHP version). |
void |
setPageUrl(String pageUrl)
Sets the Page URL. |
void |
setPlugin(BrowserPlugins plugin,
boolean enabled)
Adds a browser plugin to the list to detected plugins. |
boolean |
setRequestCookie(javax.servlet.http.Cookie requestCookie)
Sets the piwik cookie of the requester. |
void |
setResolution(int width,
int height)
Sets the screen resolution of the browser which sends the request. |
void |
setTokenAuth(String tokenAuth)
Sets the authentication string from the piwik installation for access of piwik data. |
void |
setUrlReferrer(String urlReferrer)
Sets the referrer url of the request. |
void |
setUrlReferrer(URL urlReferrer)
Sets the referrer url of the request. |
void |
setUserAgent(String userAgent)
Sets the user agent identification of the requester. |
void |
setVisitorCustomData(String visitorCustomData)
|
int |
setVisitorCustomVariable(String name,
String value)
Sets visitor custom variables; ignoring fixed order (differs from PHP version). |
void |
setVisitorId(String visitorId)
Sets the id of the requester. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int VERSION
public static final int MAX_CUSTOM_VARIABLES
public static final int MAX_CUSTOM_VARIABLE_LENGTH
| Constructor Detail |
|---|
public SimplePiwikTracker(String apiUrl)
throws PiwikException
apiUrl -
PiwikException
public SimplePiwikTracker(int idSite,
String apiUrl,
javax.servlet.http.HttpServletRequest request)
throws PiwikException
idSite - Id of the site to be trackedapiUrl - points to URL of the tracker serverrequest -
PiwikException| Method Detail |
|---|
public final String getVisitorId()
public final void readRequestInfos(javax.servlet.http.HttpServletRequest request)
throws PiwikException
request -
PiwikException - if the urls read could not be parsed to
an url objectpublic final void setAcceptLanguage(String language)
language - as a string object in ISO 639 codepublic final void setAcceptLanguage(Locale locale)
locale - as a locale object
public final void setApiurl(String apiurl)
throws PiwikException
apiurl - as a string object
PiwikException
public final void setApiurl(URL apiurl)
throws PiwikException
apiurl - as a URL object
PiwikExceptionpublic final void setCustomData(String customData)
customData - the data as a string objectpublic final void setDebugAppendUrl(String debugAppendUrl)
debugAppendUrl - public final void setForcedDatetime(Date forcedDatetime)
forcedDatetime - the time as a date objectpublic final void setIp(String ip)
ip - the ip as a string objectpublic final void setIdSite(int idSite)
idSite - public final void setPageUrl(String pageUrl)
pageUrl -
public final void setResolution(int width,
int height)
width - the screen width as an int valueheight - the screen height as an int valuepublic final boolean setRequestCookie(javax.servlet.http.Cookie requestCookie)
requestCookie - the piwik cookie as cookie object
true if the cookie was set otherwise falsepublic final void setTokenAuth(String tokenAuth)
tokenAuth - the token as a string object
public final void setUrlReferrer(String urlReferrer)
throws PiwikException
urlReferrer - The referrer URL as a string object
PiwikExceptionpublic final void setUrlReferrer(URL urlReferrer)
urlReferrer - the referrer URL as a URL objectpublic final void setUserAgent(String userAgent)
userAgent - the user agent identification as a string objectpublic final void setVisitorId(String visitorId)
visitorId - the id of the visitor as a string object
public final int setPageCustomVariable(String name,
String value)
throws PiwikException
name - Custom variable namevalue - Custom variable value
PiwikException - when the maximum size of variables is reached or the name
or the value is longer as the maximum variable length
public final int setVisitorCustomVariable(String name,
String value)
throws PiwikException
name - Custom variable namevalue - Custom variable value
PiwikException - when the maximum size of variables is reached or the name
or the value is longer as the maximum variable lengthpublic final void clearCustomVariables()
public final void setPlugin(BrowserPlugins plugin,
boolean enabled)
plugin - the plugin which was detectedenabled - true is the plugin is enabled otherwise falsepublic final void clearPluginList()
public final void setLocalTime(String time)
throws PiwikException
time - the local time as a string object in the format HH:MM:SS
PiwikExceptionpublic final void setLocalTime(Date time)
time - the local time as a date objectpublic final String getGeneralQuery()
public final URL getGoalTrackURL(String goal)
getGoalTrackURL in interface PiwikTrackergoal -
public final URL getGoalTrackURL(String goal,
String revenue)
getGoalTrackURL in interface PiwikTrackergoal - revenue -
public final URL getDownloadTrackURL(String downloadurl)
PiwikTracker
getDownloadTrackURL in interface PiwikTrackerpublic final URL getLinkTrackURL(String linkurl)
getLinkTrackURL in interface PiwikTrackerpublic final URL getPageTrackURL(String pagename)
PiwikTracker
getPageTrackURL in interface PiwikTracker
public final ResponseData sendRequest(URL destination)
throws PiwikException
destination - the built request string.
PiwikExceptionpublic String getCustomData()
public int getIdSite()
public String getPageUrl()
public String getIp()
public URL getUrlReferrer()
public String getVisitorCustomData()
public void setVisitorCustomData(String visitorCustomData)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||