Title: track-incoming-referrer
Author: averageradical
Published: <strong>10 January 2017</strong>
Last modified: 10 January 2017

---

Search plugins

This plugin **hasn’t been tested with the latest three major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/track-incoming-referrer.svg)

# track-incoming-referrer

 By [averageradical](https://profiles.wordpress.org/averageradical/)

[Download](https://downloads.wordpress.org/plugin/track-incoming-referrer.1.0.0.zip)

 * [Details](https://en-gb.wordpress.org/plugins/track-incoming-referrer/#description)
 * [Reviews](https://en-gb.wordpress.org/plugins/track-incoming-referrer/#reviews)
 *  [Installation](https://en-gb.wordpress.org/plugins/track-incoming-referrer/#installation)
 * [Development](https://en-gb.wordpress.org/plugins/track-incoming-referrer/#developers)

 [Support](https://wordpress.org/support/plugin/track-incoming-referrer/)

## Description

Non-technical summary: Track incoming referrer and write it to any hidden form field
with the identifier “referrer” (this can be created in Contact Form 7, for example;
see below). Also if the WordPress site redirects from HTTP to HTTPS, this plugin
also overrides the redirect to add the referrer to the https URL.

Technical details: This plugin runs client-side JavaScript in every page in HEAD
and if there isn’t a session cookie with the name “referrer”, then it writes a session
cookie with the name “referrer” and the value of either document.referrer, or if
that’s empty, the URL-encoded value of window.location.href. There is another client-
side JavaScript in every page before which writes the value of the “referrer” cookie
to any INPUT with the ID “referrer”, if it exists.

When integrating with Contact Form 7, add a hidden input field such as the following:

    ```
    [hidden referrer id:referrer]
    ```

And then add to the Mail’s Message Body:

    ```
    Referrer: [referrer]
    ```

If you’re just integrating this with HTML, just add this to any form:

    ```
    <input type="hidden" id="referrer" name="referrer" />
    ```

## Installation

 1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or 
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Add INPUT field to a FORM with id “referrer”

## FAQ

No FAQ

## Reviews

![](https://secure.gravatar.com/avatar/a0d89d077fd3ff3b177950289e92c05e7d4f41bb8d8748881a77e0e2b2ab289f?
s=60&d=retro&r=g)

### 󠀁[Works perfectly with WPEngine’s aggressive caching](https://wordpress.org/support/topic/works-perfectly-with-wpengines-aggressive-caching/)󠁿

 [ainsworthstudio](https://profiles.wordpress.org/ainsworthstudio/) 28 October 2017

After finding WPEngine's caching doesn't work with PHP SESSIONS I had to turn to
javascript. After trying for several days to figure out a way to get the referring
URL into our Gravity Forms, this plugin saved the day. Thank you.

 [ Read all 1 review ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/)

## Contributors and Developers

“track-incoming-referrer” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ averageradical ](https://profiles.wordpress.org/averageradical/)

[Translate “track-incoming-referrer” into your language.](https://translate.wordpress.org/projects/wp-plugins/track-incoming-referrer)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/track-incoming-referrer/),
check out the [SVN repository](https://plugins.svn.wordpress.org/track-incoming-referrer/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/track-incoming-referrer/)
by [RSS](https://plugins.trac.wordpress.org/log/track-incoming-referrer/?limit=100&mode=stop_on_copy&format=rss).

## Change Log

#### 1.0.0

 * First version

## Meta

 *  Version **1.0.0**
 *  Last updated **10 years ago**
 *  Active installations **10+**
 *  WordPress version ** 2.5 or higher **
 *  Tested up to **4.7.38**
 *  Language
 * [English (US)](https://wordpress.org/plugins/track-incoming-referrer/)
 * Tag
 * [referrer](https://en-gb.wordpress.org/plugins/tags/referrer/)
 *  [Advanced View](https://en-gb.wordpress.org/plugins/track-incoming-referrer/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/track-incoming-referrer/reviews/)

## Contributors

 *   [ averageradical ](https://profiles.wordpress.org/averageradical/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/track-incoming-referrer/)