0

I am creating an email in email studio. Once a user clicks on my CTA button I want to use their data extension field (username) to pre-fill the login form on my website.

Could I use a link such as this (example.com/login/?username=%%username%%) for the button and pass the data through the url and somehow extract that on the login page to pre-fill the field?

1

Passing the name as URL-parameter and reading it using javascript for example would be the best option for this. You could do this using the code:

AMPscript:

%%[
    Var @link
    Set @link = Concat('https://example.com/login?username=', AttributeValue('username'))
]%%
<a href="%%=RedirectTo(@link)=%%">CTA</a>

Javascript on your login-page:

var queryString = window.location.search;
var params = new URLSearchParams(queryString.substring(1)); // drops the leading "?"
var username = parseInt(params.get('username'));
  • That sounds exactly like what I need. Cheers Markus! – cmccarra Jun 21 '17 at 19:37
  • Great to hear, glad I could help! – Markus Slabina Jun 21 '17 at 19:42

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.