CF7 Silent Country Capture

Equip your sales team with regional context automatically by enriching every lead with hidden geographic metadata
Contact form 7 hidden country field

If you wish to incorporate the user’s location on Contact Form 7 forms using If-So’s geolocation service, you can follow these two simple steps:

  1. Ensure that If-So is installed on your website.
  2. In your Contact Form 7 form, add the following code to the form tab, placing it wherever you prefer.
[hidden country class:country-field]
<span class="country-shortcode" style="display: none;">
  [ifsoDKI type='geo' show='country']
</span>

Refer to the screenshot below for an example of the code added to CF7:

Contact Form 7 hidden country field
  1. On the page where you embed your Contact Form 7 form, include the following code within an HTML block, element, or mode:
<script>
  document.addEventListener('DOMContentLoaded', () => {
    let field = document.querySelector('.country-field')
    let shortcode = document.querySelector('.country-shortcode')
    field.value = shortcode.textContent.trim()
    shortcode.remove()
  })
</script>

Main Objectives

Requirments

If-So Core Plugin

Ready to get started?
Try it on your website