Print this page

Content Management - AMPScript - Conversion Tracking with AMPScript

Knowledge Article Number 000213584
Description It is possible to through AMPScript to dynamically build a URL, store it in an AMPScript variable, then include it in an email for use with Conversion Tracking. The Concat() function as well as the RedirectTo() function are required for this scenario:

Setup steps

1. Create two variables. One for the initial URL value, and one for the final URL value. 
2. Retrieve the value of your initial URL. 
3. Use the Concat function to concatenate the value of your initial URL variable with the fields used in conversion tracking and their values. Assign this as the value of your new URL variable. 
4. In the href for your link, wrap your new URL variable with the RedirectTo function. 

Example code to build the link

Var @URL, @MyURL 
Set @URL = Lookup("URL_Table","URL","URL_ID",11) 
Set @MyURL = Concat(@URL,'?j=',jobid,'&e=',emailaddr,'&l=',list_,'&u=',JobURLID,'&mid=',memberid,'&jb=',_JobSubscriberBatchID) 

Example code to place the link in HTML

<a title="My Link" href="%%=RedirectTo(@MyURL)=%%" alias="My Link">My Link</a>

promote demote