There are 2 ways that we use to pass user information to Landing Pages:
Option 1: QueryParameter
In Email:
%%[VAR @email,@name,@landingpage
Set @email = 'email@example.com'
Set @name = 'Test'
Set @landingpage = Concat('https://pub.exacttarget.com/landingpage?email=',@email,'&name=',@name)
]%%
<a href = "%%=RedirectTo(@landingpage)=%%">Click Here</a>
On LandingPage:
<form>
Name:<br>
<input type="text" name="name" value="%%=v(QueryParameter('name'))=%%"><br>
Email:<br>
<input type="text" name="email" value="%%=v(QueryParameter('email'))=%%">
</form>
Option 2: LookupRows & DataView
In Email:
%%[VAR @subscriberkey,@landingpage
Set @subscriberkey= '123456789'
Set @landingpage = Concat('https://pub.exacttarget.com/landingpage?key=',@subscriberkey)
]%%
<a href = "%%=RedirectTo(@landingpage)=%%">Click Here</a>
On LandingPage:
%%[
var @key, @email, @name
set @key = QueryParameter("key")
set @email = FIELD(ROW(LookupRows("_Subscribers","SubscriberKey",@key),1), "EmailAddress")
set @name = FIELD(ROW(LookupRows("Example_Customer_Data_DE","SubscriberKey",@key),1), "Name")
]%%
<form>
Name:<br>
<input type="text" name="name" value="%%=v(@name)=%%"><br>
Email:<br>
<input type="text" name="email" value="%%=v(@email)=%%">
</form>
Note that both of these methods are taking values from AMPScript at the time of send, and appending them to the destination URL string. For this reason, you may need some security/hashing/encoding to prevent malicious attempts to access your customer data via the form.
I hope that helps.
I had huge problems with SmartCapture forms with AMPScript inside of it and ended up developing my own form and functions to achieve my goal. What I have experienced was:
- Problems with JavaScript Functions when you click a submit element that the function popover shows errors and similar cases. (Watch developer console on browsers when you click the element)
- AMPScript variables inside hidden fields get purged once saved and the page is reopened. Making the usability just bad. [You have to enter them again and again and again].
- Using forms with JavaScript / JQuery and Post/Get events to other website works better and you are not frustrated when salesforce might change something on the smart capture forms.
I really belief that these smart capture forms are bad implemented when you want to use it with ampscript (to fill initial values).
Hope that helps.
Best Answer
I had a similar problem with SmarCapture and cloud page. The button to submit doesn't work at all. I have raised a support case on this and they said it works on their environment. So I have tried using a different DE and to my surprise, it works.
So I have created a brand new DE with exactly same attributes and I used that DE in the smart capture and it worked.
Yes there is something wrong with the current DE, support suggested that we import a file into the DE and see if it works. I haven't tried yet but will let you know soon.
I think for now you can try with a new DE.