purlTracker API

Configuration Options

[option name: default value]

autoTrack: true
Enable or disable automatic tracking of common events – inherited from the purlService object, by default.
resetTracker: false
If true, resets and clears all tracking data upon initialization – inherited from the purlService object, by default.
pageName: null
Custom page name for easier identification in reporting – inherited from the purlService object, by default.
purlCode: null
Associate all tracking activity under this purlCode – inherited from the purlService object’s auto-detection process and API events.
serviceToken: null
The campaign’s authorization token – inherited from the purlService object, by default.
profileFormIdPrefix: phProfileForm
ID prefix used to identify profile forms and bind tracking events – inherited from the purlService object, by default.
recordFormIdPrefix: phRecordForm
ID prefix used to identify profile forms and bind tracking events – inherited from the purlService object, by default.
referralFormIdPrefix: phReferralProfileForm
ID prefix used to identify profile referral forms and bind tracking events – inherited from the purlService object, by default.
conversionFlag: phtConversion
A class flag that identifies elements (form,button, a, …) that set the tracking “conversion” mark when an event is triggered by them.
downloadFlag: phtDownload
Class flag that identifies elements (form, button, a, …) to be tracked as a download, when an event is triggered by them. The purlTracker automatically attempts to determine downloadable documents by their file name extension. Under special conditions, the full file name may not be accessible to the prulTracker object. This flag allows designers to explicitly mark elements (HTML buttons and links) to be tracked as document downloads.
ignoreFlag: phtIgnore
Class flag that identifies elements to be ignored by the auto-tracking hooks.
purlRegIsConversion: true
true/false – whether purlProfile creation events (registration/signup) are automatically considered a conversion.
subDomainMode: false
If true, sets persistent session tracking mode to support sub-domain based PURLS – inherited from the purlService object, by default.
subDomainsIgnore: “www, m”
Sub-domain fragments to consider public or global for persistent session tracking when subDomainMode is on – inherited from the purlService object, by default.
rememberDays: 90
Number of days to remember persistent tracking information – inherited from the purlService object’s purlCodeStickyDays parameter, by default.
draftMode: false
Overrides the Campaign Status and forces the Tracking Mode to “Draft”, when true.

Tracking Tags

trackingTags: undefined

(config object key passed to init)

trackingTags: {
pht_medium: defaultValue,
pht_source: defaultValue,
pht_control: defaultValue
}

pht_medium: direct
Commonly refers to the delivery medium; E.g. Email, Direct Mail, QR Code etc.
pht_source: default
Commonly refers to a specific data source; E.g. Free-List, Paid-List, etc.
pht_control: default
Commonly used for arbitrary A/B testing.

URL Overrides / Query String Params

Each of the Tracking Tags above supports extraction and pickup from the URL Query String. If present in the URL, the value from the Query String tag overrides that set by the config option and/or its purl specific default. Additionally, the following Query String parameters have special meaning.

_phtSilent: null
If either true, 1, or yes – temporarily suppresses all tracking activity for the current session.
_phtDraftMode: null
If either true, 1, or yes – temporarily switches the tracking mode to the “draft” state for the current session, overriding the campaign status.
_phtResetTracker: null
If either true, 1, or yes – clears and resets all tracking data upon tracker initialization.

purlTracker Public Methods

In addition to the configuration options, a handful of utility methods are available for custom event tracking and LP specific extension to the built-in auto-tracking.

purlTracker.{method}(parameters)

purlTracker.init(configObj)
The initialization method, sets up the tracking class. Automatically invoked by the purlService init call. In normal circumstances, its not necessary to make this call directly. This method is provided for use cases where the purlTracker is used w/ out the purlService, in stand-alone mode.
purlTracker.trackSubmission(message,conversion,callBack,scope)

Custom track an event as a submit. This is normally handled by the auto-tracking hooks, however, in some instances it can be useful to call this manually.

Arguments:

    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window
purlTracker.trackDownload(message,conversion,callBack,scope)

Custom track an event as a download. Default handing by auto-tracking hooks.

Arguments:

    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window
purlTracker.trackClick(message,conversion,callBack,scope)

Custom track an event as a click. Default handing by auto-tracking hooks.

Arguments:

    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window
purlTracker.trackLink(message,conversion,callBack,scope)

Custom track an event as a click. Default handing by auto-tracking hooks.

Arguments:

    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window
purlTracker.trackOutlink(message,conversion,callBack,scope)

Custom track an event as a outlink (offsite link). Default handing by auto-tracking hooks.

Arguments:

    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window
purlTracker.trackEvent(class,message,conversion,callBack,scope)

Track an event as a custom event name. This allows the caller to set a custom classification for the event. (i.e. email sent, lead generated, etc.)

Arguments:

    class = (required) the custom event type or classification – existing types include submit, download, link, and outlink, but a custom type may be defined.
    messsage = (required) an event log message (i.e. “registration form”)
    conversion = (optional) true|false, 1|0, default=false
    callBack = (optional) a function to call upon completion of the tracking call
    scope = (optional) “this” environment relative to the callback. default=window