The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Creating an opt-in form that also redirects to a landing page

Highlighted
Occasional Visitor

Creating an opt-in form that also redirects to a landing page

I'm designing a website for my client, and he has several "teaser" videos on the home page. When the end user wants to see the full version of these videos, he/she will be required to enter a name and email address. This info not only uploads to the constant contact database, but it needs to simultaneously redirect the end user to the landing page on which the full length video resides. How the heck do I do this? 

3 REPLIES 3
Highlighted
Employee

Re: Creating an opt-in form that also redirects to a landing page

Hey Chris,

 

You have many options to do something like this.  If I were coding the site I would use the following logic:\

 

Search for contact (GET)
If(Contact != exist)
Create new contact (POST)
Programming Redirect on success 
Else IF (Contact == exist)
Get Contact (GET)
Add new list to Contacts XML
Update Contact (PUT)
Programming Redirect on success 
Else
No valid data

 As far as the response redirect you can use javascript to change the page.  You can read about how to do this here.

 

Please let me know if this helps.

Ryan Davis
Quality Engineer
Highlighted
Frequent Visitor

Re: Creating an opt-in form that also redirects to a landing page

Ryan, 

  The javascript link does not work. I also need to do this on my company web site but am at a bit of a loss. 

Highlighted
Moderator

Re: Creating an opt-in form that also redirects to a landing page

A simpler solution would be to send the informaiton to a server side page, like a .php or .aspx page.  This page would be able to send the information to Constant Contact and do any other processing you need done.  Once done, it can simply do a redirect to another page containing the full video using whatever server side development language you picked. 

 

It certainly is possible to do using XmlHttpResponse feature of JavaScript as well.  You could call a server script to do the action, return the response (success/fail) and have client side JavaScript redirect or post a response based on the success/fail message.  This is slightly more complicated as you have to create a valid response for the JavaScript to handle and have all the error handling done client side but could be a more responsive option. 

 

Hope this helps.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured