ParselyAndroid  1.0
The Parsely Android Toolkit
Public Member Functions | Static Public Member Functions | List of all members
com.parsely.parselyandroid.ParselyTracker Class Reference

Manages pageview events and analytics data for Parsely on Android. More...

Public Member Functions

void trackURL (String url)
 Register a pageview event using a canonical URL. More...
 
void trackPostId (String pid)
 Register a pageview event using a CMS post identifier. More...
 
void flush ()
 Generate pixel requests from the queue. More...
 
void setFlushTimer ()
 Allow Parsely to send pageview events. More...
 
boolean flushTimerIsActive ()
 Is the callback timer running. More...
 
void stopFlushTimer ()
 Disallow Parsely from sending pageview events. More...
 

Static Public Member Functions

static ParselyTracker sharedInstance ()
 Singleton instance accessor. Note: This must be called after sharedInstance(String, Context) More...
 
static ParselyTracker sharedInstance (String apikey, Context c)
 Singleton instance factory Note: this must be called before sharedInstance() More...
 

Detailed Description

Manages pageview events and analytics data for Parsely on Android.

Accessed as a singleton. Maintains a queue of pageview events in memory and periodically flushes the queue to the Parsely pixel proxy server.

Member Function Documentation

void com.parsely.parselyandroid.ParselyTracker.flush ( )

Generate pixel requests from the queue.

Empties the entire queue and sends the appropriate pixel requests. If shouldBatchRequests is true, the queue is sent as a minimum number of requests. Called automatically after a number of seconds determined by flushInterval.

boolean com.parsely.parselyandroid.ParselyTracker.flushTimerIsActive ( )

Is the callback timer running.

Returns
true if the callback timer is currently running, false otherwise
void com.parsely.parselyandroid.ParselyTracker.setFlushTimer ( )

Allow Parsely to send pageview events.

Instantiates the callback timer responsible for flushing the events queue. Can be called before of after stop, but has no effect if used before instantiating the singleton

static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( )
static

Singleton instance accessor. Note: This must be called after sharedInstance(String, Context)

Returns
The singleton instance
static ParselyTracker com.parsely.parselyandroid.ParselyTracker.sharedInstance ( String  apikey,
Context  c 
)
static

Singleton instance factory Note: this must be called before sharedInstance()

Parameters
apikeyThe Parsely public API key (eg "samplesite.com")
cThe current Android application context
Returns
The singleton instance
void com.parsely.parselyandroid.ParselyTracker.stopFlushTimer ( )

Disallow Parsely from sending pageview events.

Invalidates the callback timer responsible for flushing the events queue. Can be called before or after start, but has no effect if used before instantiating the singleton

void com.parsely.parselyandroid.ParselyTracker.trackPostId ( String  pid)

Register a pageview event using a CMS post identifier.

Parameters
pidA string uniquely identifying this post. This must be unique within Parsely's database.
void com.parsely.parselyandroid.ParselyTracker.trackURL ( String  url)

Register a pageview event using a canonical URL.

Parameters
urlThe canonical URL of the article being tracked (eg: "http://samplesite.com/some-old/article.html")

The documentation for this class was generated from the following file: