SwatObject
└─SiteObject
└─SiteApplicationModule
└─SiteAnalyticsModule
public class SiteAnalyticsModule
extends SiteApplicationModule
| Field Summary | |
|---|---|
| protected boolean | Whether or not to automaticlaly clean the inbound tracking id from URIs. |
| protected boolean | Whether or not to automaticlaly create Ad objects for unknown inbound tracking ids. |
| protected string | The name of the inbound ad tracking URI parameter. |
| Fields inherited from Site.SiteApplicationModule | |
|---|---|
| app | |
| Method Summary | |
|---|---|
| void | cleanInboundTrackingUri(SiteAd ad) Removes inbound ad tracking id from the URI and relocates to a clean URI. |
| void | clearAd() Clears the tracked inbound ad from the current session. |
| protected SiteAd | createAd(string shortname) Creates a new ad object with the given inbound tracking id. |
| array | depends() Gets the module features this module depends on. |
| SiteAd | getAd() Gets the tracked inbound ad for the current session. |
| void | init() Initializes this analytics module. |
| protected void | initAd() Reads inbound tracking ids from the request URI and saves a new ad referrer. |
| protected void | insertInboundTrackingReferrer(SiteAd ad) Inserts a referrer for an inbound tracking id. |
| void | setAutocleanUri(boolean clean) Sets whether or not inbound tracking ids should be automatically cleaned from URIs. |
| void | setAutocreateAd(boolean create) Sets whether or not inbound ad tracking ids should automatically create Ad objects in the database. |
| void | setInboundTrackingId(mixed id, string the) Sets the name of the URI parameter used for tracking inbound ads. |
| Methods inherited from Site.SiteApplicationModule | |
|---|---|
| depends, init, provides | |
protected boolean $autoclean_uri = false
Whether or not to automaticlaly clean the inbound tracking id from URIs
Defaults to false.
protected boolean $autocreate_ad = false
Whether or not to automaticlaly create Ad objects for unknown inbound tracking ids
Defaults to false.
protected string $inbound_tracking_id = 'ad'
The name of the inbound ad tracking URI parameter
Defaults to 'ad'. Google Analytics users may want to change this to 'utm_source' or 'utm_campaign'.
public void cleanInboundTrackingUri(SiteAd ad)
Removes inbound ad tracking id from the URI and relocates to a clean URI
ad - the inbound tracking ad to clean from the URI.public void clearAd()
Clears the tracked inbound ad from the current session
protected SiteAd createAd(string shortname)
Creates a new ad object with the given inbound tracking id
shortname - the inbound tracking id of the Ad.public array depends()
Gets the module features this module depends on
The site analytics module depends on the SiteSessionModule and SiteDatabaseModule features.
public SiteAd getAd()
Gets the tracked inbound ad for the current session
public void init()
Initializes this analytics module
Stores ad object in the session module and initializes ad database reference.
protected void initAd()
Reads inbound tracking ids from the request URI and saves a new ad referrer
If autoclean URI is specified, after the referral is logged, the inbound tracking id is removed from the URI through a relocate.
protected void insertInboundTrackingReferrer(SiteAd ad)
Inserts a referrer for an inbound tracking id
This is used to cout the number of site referrals for a particular tracking id.
ad - the inbound ad to track.public void setAutocleanUri(boolean clean)
Sets whether or not inbound tracking ids should be automatically cleaned from URIs
clean - optional. True if inbound tracking ids should be automatically cleaned from URIs and false if they should not. If set to true, the ad tracking id is removed from the URI and a relocate is performed.public void setAutocreateAd(boolean create)
Sets whether or not inbound ad tracking ids should automatically create Ad objects in the database
create - optional. True if unknown inbound ad tracking ids should automatically create an Ad object in the database and false if they should not.public void setInboundTrackingId(mixed id, string the)
Sets the name of the URI parameter used for tracking inbound ads
the - name of the URI parameter used for tracking inbound ads. Example: 'utm_source'.
Web application module for handling site analytics and ad tracking