Adding Hidden Fields to Contact Form 7
Contact Form 7 is a very popular, free WordPress plugin that allows you to create forms on your website.
Attributer can write marketing channel information to hidden fields in Contact Form 7 so that you know exactly how your leads are finding you.
To add hidden fields to your Contact Form 7 forms, follow the instructions below:
Step 1: Add the hidden fields to your forms
First, navigate to the form you want to capture marketing channel information through and open the editor.
In the ‘Form’ tab, you’ll need to copy and paste the following code:
[hidden Channel "[channel]"] [hidden Channel-Drilldown-1 "[channeldrilldown1]"] [hidden Channel-Drilldown-2 "[channeldrilldown2]"] [hidden Channel-Drilldown-3 "[channeldrilldown3]"] [hidden Landing-Page "[landingpage]"] [hidden Landing-Page-Group "[landingpagegroup]"]
You can enter it anywhere in the form, but we recommend entering it below the last non-hidden form field and above the submit button. See screenshot below:
Once you’ve added the code, click the ‘Save’ button to save your form.
Step 2: Clear your cache
If your site is hosted by WordPress hosts like WPEngine or Kinsta (who use page caching to speed up your website), or if you have a caching plugin installed (like WP Rocket, Autoptimise, etc), then you may need to clear your cache in order for these new hidden fields to start appearing on your site.
The plugin or host will have documentation on how to do this. Simply Google ‘clear page cache WPEngine’ (and replace WPEngine with whatever host or caching plugin you use).
Can't find the answer you need? Contact us!
Our team are available to answer any questions you have