Authors

Direct Email Marketing

AMPscript Tip: Links in a Data Extension

Friday, November 20, 2009 by Kristeen Hudson
Have you ever tried to pull a URL from a Data Extension and use it as a link in an email within the ExactTarget email application? If you have you have probably noticed that when your link is clicked it doesn’t work. Here is an example of what I’m taking about:

<a href="%%= v(@link)=%%">%%=v(@type)=%%</a>


Note that in this example @link references a value from a Data Extension.

If you have done this then you know that instead of taking you to your URL that is stored in the Data Extension you get directed to a long URL starting with “http://cl.exct.net.”

The good news is there is an easy way to fix these links. There is an AMPscript function called RedirectTo() that must be used when referencing links in a Data Extension. So your new link would look like this:

<a href="%%=RedirectTo(@link)=%%">%%=v(@type)=%%</a> 

If you want more information about the RedirectTo AMPscript function or about creating targeted emails using AMPscript there is some good documentation on the Documentation Wiki.

Comments for AMPscript Tip: Links in a Data Extension

Leave a comment





Captcha