3

I'm trying to send an email to Data Extension A that will link users to a Marketing Cloud Landing Page with a Smart Capture form. The Smart Capture form is updating Data Extension B.

The form that updates Data Extension B has a field for email address, and I'm trying to pre-populate that field on the Smart Capture form with the email address in the sending data extension, Data Extension A.

I'm having trouble getting it to work. Does anyone have some sample AMPScript that I could try for this?

Thanks.

  • Having trouble understanding your question clearly. Is it that you want to populate the email address on form B from the Data Extension A? – Maneesh Mar 19 '17 at 17:21
  • Yes, that's it. – PhilipW Mar 19 '17 at 18:47
  • Please post what code you have so far. – Adam Spriggs Mar 19 '17 at 20:33
3

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.

  • Thanks. I tried it out and got it to work. I appreciate the help. – PhilipW Apr 2 '17 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.