Track WordPress Page/Post URL Form Submissions in Contact Form 7
I was recently asked to set up a WordPress site, with a contact form which could be placed into all product catalogue pages.
No problem, the Contact Form 7 plugin lets me set up a contact form, and gives me a handy shortcode which I can use to insert the form anywhere within a page or post.
BUT, they also wanted to know which page the form was submitted from, so that they could track the page from which the enquiry was sent, and send relevant information based on which page the user filled out the form on.
So I had a look at the Contact Form 7 documentation where I found that there are some special mail tags you can add into your message body, to collect more detailed information about the form submission.
To collect the URL of the page where the form was submitted, you just need to paste [_post_url] into the message body of your contact form.
There are several other special mail tags you can use if you want to collect more details, such as post author, post date or sender’s IP address.
Recommended Posts
How To Disable WordPress Theme Update Notification (No Plugin)
September 14, 2021
How to Hide Featured Image in Single Post on WordPress
October 8, 2020
How to Track WordPress Site Searches in Google Analytics
October 6, 2020