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 Answer 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:


    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
    Commented Jun 21, 2017 at 19:37
  • Great to hear, glad I could help! Commented Jun 21, 2017 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .