purlhub

Support Center

purlTracker JSAPI v1.7

Last Updated: Mar 07, 2016 11:04AM MST

The purlTracker JSAPI powers purlHub's proprietary tracking service, a tracking and reporting tailored to Personalized URL campaigns and Personalized Web Activity.  Like the purlService JSAPI, it is designed to persist a tracking trail across multiple page requests and return visits.
 

Automatic Tracking of Basic Events

In a standard purlService implementation, nothing extra needs to be done to enable the purlTracker.  Its automatically included and enabled by default, and automatically tracks basic events, including:

  • All form submissions, distinctly identifying purlProfile and purlRecord activity.
  • Page visits, categorized as personalized or anonymous.
  • Downloads matching common document file formats.
  • All link click activity (categorized as both internal and outbound).
  • Flagging event as "Conversion" events. 

In addition, the purlTracker API also exposes a complete set of utility methods for custom tracking.
 

purlTracker Options

The purlTracker API, like the purlService API, offers an assortment of configuration options.  If implemented along-side the purlService API, all purlTracker options can simply be passed through by including them in the options Object passed to the purlService.init(Obj) call along with any purlService options.  In stand-alone fashion, the purlTracker options are simply passed as an object to the purlTracker.init(Obj) call, in similar fashion to the purlService API.
 

Example initialization:

<link type="text/css" rel="stylesheet" media="screen" href="http://library.cdn.purlhub.com/purlHub.css" />
<script type="text/javascript" src="http://api.purlhub.com/JSAPI/purlServiceApi.min.js?vz=1505"></script>
<script type="text/javascript">

    var options = {
        pageName: 'My Landing Page',
        serviceToken: '{your campaign service token}',

        /* purlTracker specific options */
	autoTrack:              true,
	profileFormIdPrefix:    'ppForm',
	recordFormIdPrefix:     'prForm',
	conversionFlag:         'phtConversion',
	downloadFlag:           'phtDownload',
	ignoreFlag:             'phtIgnore',
	purlRegIsConversion:    true,
	trackingTags: {
            pht_medium:     'direct',
            pht_source:     'default',
            pht_control:    'default'
	}
    };

    purlService.init(options);

</script>

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 record 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:

purlHub provides tracking tags for inbound traffic and list source attribution. Tracking tags can be used to flag and filter visitors for advanced analytics and campaign performance analysis. Established tracking tag values are persisted in a temporary session cookie, and recalled from page to page.  Tracking tags can also be set as purlAttributes, or purlProfile properties and then act as a purl specific default.

  • 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 menaing. 
 

  • _phtSilent: null
    if either true, 1, or yes - suppresses all tracking activity for the current client (browser).  The inverse value removes the suppression flag, resuming tracking activity.  This flag is persisted across the current session and return visits.
     
  •  _phtDraftMode: null
    If either true, 1, or yes - sets the pURL visitor tracking mode to the "draft" state for the current client (browser), overriding the default campaign status.  The inverse value, disables the override returning tracking to the default campaign status.  This flag is persisted across the current session and return visits.
     
  • _phtResetTracker: null
    If either true, 1, or yes - clears and resets all tracking data upon tracker initialization.  By default, yet defeatable, inherits a true value when the purlService.resetService is true. 
     

purlTracker Public Methods: purlTracker.{method}(parameters)

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.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 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.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

     

Contact Us

  • Post a Public Question
  • Ask the Community
  • Email Us

Recent Discussions

Ajax-loader-small