Tracking code persist

Categories

Component ID

2820394

Component name

Tracking code persist

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

604

Component created

Component changed

Component body

This module detects specially-defined URL paths and/or query-string
parameters, stores them in a cookie for later, and strips them from the
browser location bar.

Such "remembered" codes may then be injected into arbitrary form
submissions on the site. Webform integration is provided too.

Installation

This module depends on the URI.js library. Download the latest version
from https://github.com/medialize/URI.js/releases and place it in your
site libraries directory, in a directory called "urijs", for example:

sites/all/libraries/urijs/src/URI.min.js

The module may be configured at:

admin/config/system/tracking_code_persist

Drupal dependencies

This module depends on the Libraries module.

Webform mailchimp integration

If using the Webform mailchimp module, the following patch must be applied to fix the format of tracking code values sent to Mailchimp:

#2820445: Permit components to control the rendering of merge-field values

Global Redirect

When using the Auto-create URL aliases option (or otherwise) to create aliases for your tracking code paths to the homepage, you must disable Global Redirect module's Frontpage Redirect Handler option. Otherwise the page is redirected before the javascript can detect the path, and the value is lost.

Browser Caching

It appears that certain browsers (observed in Google Chrome) will cache the javascript redirect, including the setting of the cookie. If you are relying on users landing on more-than-one tracking_code_persist path, you may find the cookie does not contain what you would expect where the user revisits previously visited paths. For example.

See #2820498: What can we do about browser caching the cookie-setting/redirect? for more details.