Contact Form 7 (CF7) forms provide excellent reusability. You can use the same form on multiple posts of your website. You can even use the same form across multiple websites by using the Visual Data feature of the CF7 Skins Visual Editor.
However, when you use the same form on multiple posts or multiple websites, it may be hard to keep track of where each submission came from.
This article will show you how you can use the emails you receive on each form submission to keep track of the website or post that it was submitted on.
Before you begin
But before we get started, there are a few things you need to do.
- Complete your form using either Contact Form 7 or the CF7 Skins Visual Editor and copy its shortcode wherever you want the form to appear.
- Understand what Special mail tags are and how to use them.
Keeping track of submitted forms
1. Go to Contact >> Contact Forms and find your form.
This example shows a generic subscription form which can be used in different posts across multiple websites. In this case, you may need to know which page, post or website draws the most subscribers.
2. Go to the Mail tab.
3. Add the following special mail tagsMail Tag Mail Tags are used in Contact Form 7 (CF7) (in the Mail Tab) to show information collected from CF7 form fields (in the Form Tab) in emails sent by CF7. in the Message body to track the website and post:
- [_post_url] provides the URL of the corresponding post or page.
- [_post_title] gives the name of the corresponding post or page.
- [_site_title] gives the title of the website where the form was submitted.
- [_site_url] provides the URL of the website where the form was submitted.
Tip: The tags starting with _post can be used for pages as well.
4. Click Save.
Now, if a user submits the form with the following data:
You receive this email:
Now, you know exactly which page and website each form response was submitted to.