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.
Your solution is relatively simple. Combine Lookups/AttributeValue functions with a CONCAT and RedirectTo.
example:
%%[
SET @SFID = AttributeValue("Account_ID")
SET @BaseURL = Lookup("yourSeperateDE", "BaseURL", "SFID", @SFID)
SET @SourceCode = Lookup("yourSeperateDE", "SourceCode", "SFID", @SFID)
SET @ListNumber = Lookup("yourSeperateDE", "ListNumber", "SFID", @SFID)
SET @SendType = Lookup("yourSeperateDE", "SendType", "SFID", @SFID)
SET @IP = Lookup("yourSeperateDE", "IP", "SFID", @SFID)
SET @Attribute = Lookup("yourSeperateDE", "Attribute", "SFID", @SFID)
SET @URL = CONCAT('http://', @BaseURL, '?sfid=', @SFID, '&source=', @SourceCode, '-', @ListNumber, '-', @SendType, '-', @IP, '&client=', @Attribute)
]%%
OUTPUT in href:
<a href=%%=RedirectTo(@URL)=%%" >your link</a>
Now if you are looking to get listid from SFMC and not a seperate list number you created, you would need to change it to:
SET @ListNumber = AttributeValue('listid')
The sending IP is not something you can collect at send time. You would need to store this in DE.
If you are going to use something other than the Account ID to house this, you would just need to define that in the AMPScript and replace the SFID part of the lookups with your unique ID name/values.
Best Answer
You've got to establish the lookup parameters in order to retrieve the coupon codes. The
emailaddr
is a personalization string present in all email sends.Reference