I have a Wordpress website at example.com and I have a landing page at example.com/landing-page. The landing page has a form for users to fill out to get a free consultation.
Is there a way to install a cookie or something so that when first-time visitors visit example.com, they are redirected to example.com/landing-page. But after they fill out the form on the landing page, the next time they visit example.com, they will see the regular homepage (not be redirected).
You could use javascript for this. Make sure that you have jQuery included.
Add the following to your global javascript file that's included on both pages as we'll be using these helper functions on both the homepage and the landing page to check if the cookie exists and also to create it.
Include the following script on your homepage which basically checks to see if the cookie 'form_submitted' exists, if not then redirect the user to the landing page.
And on the landing page, you'll need to add the following javascript which binds a listening event for submit of the form and when it happens it creates the cookie and therefore the next time the user goes to the homepage, they won't be redirected.
I hope this helps. Good luck! =)
Edit: I've just read comments that were left on your original post whilst I was writing my answer. Just wanted to add that the create_cookie function I've added allows you to pass in the number of days, 30 in my example, before you want the cookie to expire so you could set that quite high to make it last longer.
Obviously there's always the risk with javascript cookies that people clear their browser cookies but there's no other way to track something like this on users that are not logged in. What could be more secure in terms of users not be able to remove it is PHP sessions stored on the server but that's going to be a lot more difficult than this and even that's not bullet proof as user data that you use to associate the user to a session with can change like their IP, browser etc so there's always a risk.
What you could have on the form page is a link saying "I've already completed this form, take me to the main website" which sets the cookie again.
Lastly, you'll notice that my solution is lightweight and includes no unnecessary plugins like $.cookie as I've used javascript in large part, only using jQuery for document ready and binding the submit event.
If you need a plugin to set a cookie where user visit your home page (not any other page) i had that same problem before and created a plugin to handle that
Find it on https://wordpress.org/plugins/redirect-to-welcome-or-landing-page
All you need to do is to set the url you need your user to be redirected to then it will handle the cookie creation and the redirection code that so search engines know it is a temporary redirection.
If you don't have a lot of time it might be easier to install a plugin and configure it to meet your needs. Try http://wordpress.org/plugins/landing-pages/ and if it's not what your looking for try looking for more plugins.