Title: Lead info with country for contact Form 7
Author: apasionados
Published: <strong>13 Dujember 2014</strong>
Last modified: 27 Yennayer 2026

---

Search plugins

![](https://ps.w.org/contact-form-7-lead-info-with-country/assets/banner-772x250.
png?rev=1043884)

![](https://ps.w.org/contact-form-7-lead-info-with-country/assets/icon-128x128.png?
rev=1043884)

# Lead info with country for contact Form 7

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

[Download](https://downloads.wordpress.org/plugin/contact-form-7-lead-info-with-country.2.6.zip)

 * [Details](https://kab.wordpress.org/plugins/contact-form-7-lead-info-with-country/#description)
 * [Reviews](https://kab.wordpress.org/plugins/contact-form-7-lead-info-with-country/#reviews)
 *  [Installation](https://kab.wordpress.org/plugins/contact-form-7-lead-info-with-country/#installation)
 * [Development](https://kab.wordpress.org/plugins/contact-form-7-lead-info-with-country/#developers)

 [Support](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/)

## Description

Lead info with country for Contact Form 7 is an **addon module for the [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
plugin**. It helps you track the user who fills out a form.
 All you need to do 
is add the _[tracking-info]_ shortcode in the Message body of the contact form 7.

> Since version 1.5.0 you can also use the shortcode _[tracking-info-noip]_ in the
> Message body of contact form 7 which will not include the IP of the user in case
> you have concerns regarding the General Data Protection Regulation (EU) 2016/679(«
> GDPR »).

This plugin is an enhanced version of the plugin [Contact Form 7 Leads Tracking](https://wordpress.org/plugins/contact-form-7-leads-tracking/),
that includes translations and the lookup of the country of the IP from which the
form is sent.

We decided to create this enhanced version of the plugin, because we needed a translation
to Spanish and wanted to know the country from which the uses send the contact form,
whithout having to lookup the IP adress.

The lead tracking info includes: Form Page URL, Original Referrer, Landing Page,
User IP, Country of the User IP and Browser.

In order to display the Country it needs the [Geolocation IP Detection (until March 2020: GeoIP Detection) plugin](https://wordpress.org/plugins/geoip-detect/)
that can be found in the WordPress plugin repository. This plugin « provides geographic
information detected by an IP adress ». _This plugin auto-updates the GeoIP database
once a week. This product includes GeoLite data created by MaxMind, available from
[www.maxmind.com](http://www.maxmind.com)._

If the [Geolocation IP Detection (until March 2020: GeoIP Detection) plugin](https://wordpress.org/plugins/geoip-detect/)
is not installed and enabled, you will only see the IP address, without the country
of the IP adress.

We decided to use the Geolocation IP Detection (until March 2020: GeoIP Detection)
plugin to handle the lookup of the country, because it’s a plugin that is actively
developed and we saw no advantage in implementing all this functionality, when we
could use an existing one.

The lead tracking info in this plugin includes:

 1. **Form Page URL**
     The URL on which the user filled out the form.
 2. **Original Referrer**
     The URL from which the user came to your site.
 3. **Landing Page**
     The first page the user visited on your site.
 4. **User IP** (is not included when using the shorcode [tracking-info-noip])
     The
    IP address of the user who filled out the form.
 5. **Country of the IP**
     The country of the IP address of the user who filled out
    the form. If the country is 0, please check the FAQ information.
 6. **User Agent / Browser**
     The browser information of the user who filled the form.

> **Please make sure that WP_DEBUG in wp-config.php is set to FALSE when using this
> plugin in production.** If it’s true the message is sent but the AJAX code to 
> show the OK message and clear the form is not executed. This has to do with the
> Contact Form 7 filter: _wpcf7\_mail\_components_ we use for adding the tracking
> information and we can’t change this behaviour. Please be aware of this.

#### Lead info with country for Contact Form 7 in your Language!

This first release is avaliable in English and Spanish. In the languages folder 
we have included the necessary files to translate this plugin.

If you would like the plugin in your language and you’re good at translating, please
drop us a line at [Contact us](https://apasionados.es/contacto/index.php?desde=wordpress-org-contactform7leadinfowithcountry-home).

#### Further Reading

You can access the description of the plugin in Spanish at: [Lead info with country for Contact Form 7 en castellano](https://apasionados.es/blog/informacion-pais-contact-form-7-plugin-wordpress-6061/).

### contact

For further information please send us an [email](https://apasionados.es/contacto/index.php?desde=wordpress-org-contactform7leadinfowithcountry-contact).

## Screenshots

[⌊A sample email with the tracking information generated by the plugin.⌉⌊A sample
email with the tracking information generated by the plugin.⌉[

A sample email with the tracking information generated by the plugin.

[⌊Shortcode in the contact Form 7 message body.⌉⌊Shortcode in the contact Form 7
message body.⌉[

Shortcode in the contact Form 7 message body.

## Installation

 1. Upload the `contact-form-7-lead-info-with-country` folder to the `/wp-content/plugins/`
    directory (or to the directory where your WordPress plugins are located)
 2. Activate the « Lead info with country for Contact Form 7 » plugin through the ‘
    Plugins’ menu in WordPress.
 3. Plugin doesn’t need any configuration but you have to paste one of the shortcodes
    in the MESSAGE BODY of the form where you want to include the tracking info.

## FAQ

### What is Lead info with country for Contact Form 7 good for?

This plugin adds the Form Page URL, Original Referrer, Landing Page, User IP, Country
of the User IP and Browser to Contact Form 7 when inserting the [tracking-info] 
shortcode in the Message body.
 If the shortcode [tracking-info-noip] is used the
plugin does not add the User IP but adds the other information: Form Page URL, Original
Referrer, Landing Page, Country of the User IP and Browser.

### What about the General Data Protection Regulation (EU) 2016/679 (« GDPR »)?

If you are concerned about the the General Data Protection Regulation (EU) 2016/
679 (« GDPR ») you can use the [tracking-info-noip] shortcode which does not include
the User IP in the email sent.

### Do I need to install another plugin to make this one work?

Lead info with country for Contact Form 7 is an **addon module for the Contact Form
7 plugin**. You need to have [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
installed and active.
 In order to display the Country it needs the [Geolocation IP Detection (until March 2020: GeoIP Detection) plugin](https://wordpress.org/plugins/geoip-detect/)
that can be found in the WordPress plugin repository. This plugin « provides geographic
information detected by an IP adress ». _This plugin auto-updates the GeoIP database
once a week. This product includes GeoLite data created by MaxMind, available from
[www.maxmind.com](http://www.maxmind.com)._

If the [Geolocation IP Detection (until March 2020: GeoIP Detection) plugin](https://wordpress.org/plugins/geoip-detect/)
is not installed and enabled, you will only see the IP address, without the country
of the IP adress.

IMPORTANT: When you install the Geolocation IP Detection (until March 2020: GeoIP
Detection) plugin for the first time, it’s important that you go to Tools > Geolocation
Lookup and click on « Upgrade now ». When activated the plugin does not download
the GeoIP database automatically. You have to download it the first time by clicking
on « Upgrade now ». If you don’t install the database, the Country code is 0.

_Please note that the size of the database « Maxmind GeoIP Lite City » is around
55MB_. But you can also decide to use the « HostIP.info Web-API » which doesn’t 
require the download of any database and makes the IP query online **(HostIP.info
Web-API only supports English names and does only have the following fields: country
name, country ID and city name)**.

### The result for the Country is 0. What can I do?

When you install the Geolocation IP Detection (until March 2020: GeoIP Detection)
plugin for the first time, it’s important that you go to Tools > Geolocation Lookup
and click on « Upgrade now ». When activated the plugin does not download the GeoIP
database automatically. You have to download it the first time by clicking on « 
Upgrade now ». If you don’t install the database, the Country code is 0.

### How exact is the Country data?

Think of it as an « educated guess »: IP adresses and their allocation change on
a frequent basis. If you need [more exact data](http://www.maxmind.com/en/geolite_city_accuracy),
consider purchasing the commercial version of the data.

### Does Lead info with country for Contact Form 7 make changes to the database?

The plugin doesn’t make any changes to the database. It only adds the tracking info
to the email sent by contact form 7.

### How can I check out if the plugin works for me?

Install and activate. Paste shortcode in Contact Form 7 Message body. Test contact
form. In the email you receive you should see the tracking info added where you 
placed the shortocde.

### How can I remove Lead info with country for Contact Form 7?

You can simply activate, deactivate or delete it in your plugin management section.

As there is no data stored in the database you can delete it safely through FTP.
Please remind to remove the shortcodes in the contact forms. If the plugin is not
active the shortcode will not be replaced with the info and it will be displayed
as [tracking-info] or [tracking-info-noip].

### Are there any known incompatibilities?

If you are using [Contact Form 7 Leads Tracking](https://wordpress.org/plugins/contact-form-7-leads-tracking/)
and this plugin is active, the Lead info with country for Contact Form 7 will not
work.

### Does your plugin work with mail services like MAILGUN?

The plugin works correclty with Mailgun but there is something to take into account.
If the emails are sent as plain text emails and you are using Mailgun open tracking,
the emails are converted to HTML but the line breaks are lost. We have not found
a solution for this. If the emails are sent as HTML text emails, there is no problem.

### Why does this plugin offer no support for WordPress versions before 3.5?

Because the [Geolocation IP Detection (until March 2020: GeoIP Detection) plugin](https://wordpress.org/plugins/geoip-detect/)
needs at least WordPress 3.5, we decided to also ask for a version equal or higher
than WordPress 3.5.

### When using this plugin and send a message in a contact form apparently nothing happens

Please make sure that WP_DEBUG in wp-config.php is set to FALSE when using this 
plugin in production. If it’s true the message is sent but the AJAX code to show
the OK message and clear the form is not executed.

### Do you make use of Lead info with country for Contact Form 7 yourself?

Of course we do. 😉

## Reviews

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

### 󠀁[great job](https://wordpress.org/support/topic/great-job-371/)󠁿

 [Marius](https://profiles.wordpress.org/mmichtus/) 3 Ctember 2016 1 reply

easy everthing you need for tracking!

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

### 󠀁[Gives usefull information about people that fill in forms](https://wordpress.org/support/topic/gives-usefull-information-about-people-that-fill-in-forms/)󠁿

 [elians](https://profiles.wordpress.org/elians/) 3 Ctember 2016

It gives additional information about people that fill in a Contact form, just what
we were looking for.

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

### 󠀁[Excellent, does what I need](https://wordpress.org/support/topic/excellent-does-what-i-need/)󠁿

 [Lab Lover](https://profiles.wordpress.org/peterscaffidi/) 3 Ctember 2016 4 replies

Allows for the inclusion of contact form sender Geo IP location information. Includes,
country, city, state and even zip code. I would like to be able to limit some of
the user agent information.

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

### 󠀁[Maravilloso](https://wordpress.org/support/topic/maravilloso-5/)󠁿

 [ozonito](https://profiles.wordpress.org/ozonito/) 8 Furar 2017

Un plugin muy operativo y funcional. Saludos desde Canarias.holiday, Waptab.com 
and Wasesores.com and PlayUnion.com.

 [ Read all 8 reviews ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/)

## Contributors & Developers

“Lead info with country for contact Form 7” is open source software. The following
people have contributed to this plugin.

Contributors

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

[Translate “Lead info with country for contact Form 7” into your language.](https://translate.wordpress.org/projects/wp-plugins/contact-form-7-lead-info-with-country)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/contact-form-7-lead-info-with-country/),
check out the [SVN repository](https://plugins.svn.wordpress.org/contact-form-7-lead-info-with-country/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/contact-form-7-lead-info-with-country/)
by [RSS](https://plugins.trac.wordpress.org/log/contact-form-7-lead-info-with-country/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.6 (27/MAY/2025)

 * Added info when landing page on site is not available and « /wp-json/contact-
   form-7/v1/contact-forms/ » or similar is shown as landing page. Instead of this
   URL a clear message is displayed now: « Not available. Probably because of do
   not track or similar privacy technology. »

#### 2.5 (24/FEB/2022)

 * Made changes to session_destroy() to prevent resetting the session to early. 
   Thanks to @edioreza for brinnging this to our attention. Also included code from
   Tony J. to show path on website before filling and sending the form (we are testing
   this as we are not sure how it will behave on large sites).

#### 2.4.1 (08/JAN/2021)

 * Small bug fix to prevent error: « Use of undefined constant body – assumed ‘body’
   in wpshore_cf7_lead_tracking.php on line 61 ».

#### 2.4 (07/JAN/2021)

 * Added check for headers_sent() on line 29 to prevent the « cannot start session
   when headers already sent » error that some users were seeing in their logs.

#### 2.3 (22/OCT/2020)

 * Changed array used to detect if email sent is HTML or plain text to prevent error:«
   Use of undefined constant body – assumed ‘body’ in wpshore_cf7_lead_tracking.
   php on line 61 ».

#### 2.2 (08/JAN/2020)

 * Made a change to how we handle session_destroy() to prevent error: « Trying to
   destroy uninitialized session in wpshore_cf7_lead_tracking.php on line 55 ».

#### 2.1 (20/NOV/2019)

 * Solved « Site Health » error: « The REST API encountered an error ».

#### 2.0 (19/SEP/2019)

 * Updated name from « Contact Form 7 Lead info with country » to « Lead info with
   country for Contact Form 7 » in order to comply with the WordPress plugin repository
   trademark guidelines.

#### 1.6.0 (27/JUN/2019)

 * Updated check for HTML or PLAIN TEXT to make line breaks correctly.

#### 1.5.1 (15/FEB/2019)

 * Updated translation files and added POT file to translate to other languages.

#### 1.5.0 (14/FEB/2019)

 * Add new shortcode [tracking-info-noip] which does not include the User IP in 
   the email sent.

#### 1.4.3 (12/JUL/2018)

 * Removed line break when PROXY is detected.

#### 1.4.2 (03/JAN/2018)

 * Added declaration of variable $trackingInfo to avoid « Notice: Undefined variable:
   cf7isSecure » with PHP 7.

#### 1.4.1 (10/SEP/2017)

 * Added declaration of variable $cf7ltisSecure to avoid « Notice: Undefined variable:
   cf7isSecure » with PHP 7.

#### 1.4.0

 * Added check for landing page protocol. Now it will show https or http depending
   if there is a SSL certificate in use on the landing page.

#### 1.3.2

 * Added GEO info for Proxy Server IP when set.

#### 1.3.1

 * Some code improvements.

#### 1.3

 * Changed function used to retrieve the IP data from « GeoIP Detection » to support
   reverse proxies.

#### 1.2

 * Solved error when WordPress DEBUG was true: « Notice: Undefined index: HTTP_REFERER»
   when HTTP_REFERER was not set by browser

#### 1.1.1

 * Change to solve error in line 101 of the plugin when WordPress DEBUG is TRUE:
   Notice: « Undefined index: HTTP_REFERER in contact-form-7-lead-info-with-country/
   wpshore_cf7_lead_tracking.php on line 101 »

#### 1.1

 * First stable release.

#### 1.0

 * Second beta release.

#### 0.5

 * Beta release.

## Meta

 *  Version **2.6**
 *  Last updated **9 n wagguren ago**
 *  Active installations **3,000+**
 *  WordPress version ** 3.5 or higher **
 *  Tested up to **6.9.10**
 *  PHP version ** 5.3 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/contact-form-7-lead-info-with-country/)
 * Tags
 * [contact form 7](https://kab.wordpress.org/plugins/tags/contact-form-7/)[lead tracking](https://kab.wordpress.org/plugins/tags/lead-tracking/)
   [user info](https://kab.wordpress.org/plugins/tags/user-info/)
 *  [Advanced View](https://kab.wordpress.org/plugins/contact-form-7-lead-info-with-country/advanced/)

## Ratings

 4.2 out of 5 stars.

 *  [  4 5-star reviews     ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/?filter=2)
 *  [  1 1-star review     ](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/reviews/)

## Contributors

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

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/contact-form-7-lead-info-with-country/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://apasionados.es/)