Using Personalization Strings with AMPscript

From $1

    Doc-Wiki-BannerHK.png

    (Click the banner to go to the related Docs.Code.ExactTarget.com page.)

    You can use system personalization strings when building AMPscript expressions. For example, you might want to display a different message or text based on the day of the week or the month. You could the xtdayofweek or xtmonth system personalization string, respectively, for these purposes.  Other common uses for system personalization strings include passing identifiers, such as the unique email, job, or subscriber ID/key to a web page or web analytics solution for the purposes of tracking subscriber behavior.

    Personalization strings that appear in AMPscript function calls cannot include the surrounding percent symbols. For example, this code in AMPscript is invalid:

    %%=UPPERCASE(%%emailaddr%%)=%%

    This format, however, is valid:

    %%=UPPERCASE(emailaddr)=%%

    This section lists the system personalization strings (in the past referred to as system data substitution strings) that you can insert into your email. You can type these fields directly into the HTML of your email body if you are creating an HTML paste email, or you can type them directly into the text editor of the Content-Building Wizard when you create or modify the text of a content box.

    Note the following:

    • All personalization strings are case-insensitive.
    • When working with personalization strings outside of an AMPscript block, you must include the two sets of double percent symbols (two percent symbols on either side of the personalization string). For example, a personalization string used in email might look like this:

    %%fullname%%

    • When working with personalization strings inside an AMPscript block, do not use the two sets of double percent symbols. A personalization string within an AMPscript might look like this:

    fullname

    additionalinfo_

    This is populated only if a specific feature is enabled (Event ID functionality). It is a way to perform a send level substitution that the declared substitution value gets applied across all emails for that particular send. When an additionalinfo_ system personalization string is found, that string is replaced with the value that was declared at send.

    comment_ or comment

    System default user-defined profile attribute.

    emailaddr

    Subscriber's email address.

    _EmailID

    The email ID. This ID number is assigned by the system.

    emailname_

    Name of the email send.

    firstname_ or firstname

    First part of the fullname attribute subscriber or the first name.

    ftaf_url

    Forward to a Friend URL personalization string.

    fullname_ or fullname

    System default Full Name profile attribute.

    _ImpressionRegionID

    Returns the active region ID or 0 if none is active.

    _ImpressionRegionName

    Resolves to the currently active impression region or evaluates to an empty string if no impression region has been set.

    _IsTestSend

    Resolves to True if the email job is marked as a Test Send.

    %%[
    if _isTestSend == false then
    ... // this code will not run for test sends
    endif
    ]%%

    jobid

    Email or SMS send ID (the unique identifier associated with this send of the email, for tracking purposes).

    _JobSubscriberBatchID

    This value ties a Triggered Send Job or a Subscriber Key Send Job to a Subscriber to a Batch ID.

    In triggered sends, for one Job ID there are potentially multiple sends to a subscriber, so you can't count on the combination to be unique. By adding the BatchID, there is enough information to correlate clicks, bounces, opens, and unsubscribes back to the original send.

    The other place that JobSubscriberBatch could be used is in Subscriber Key based sends. If a send contains duplicate email addresses, each email address will have a different Job Subscriber Batch.

    By default, JobSubscriberBatch is 0.

    list_

     

    ExactTarget list ID and type (for example, 12345_HTML).

    listid

    ExactTarget  list ID (for example, 1234).

    _ListName

    The name of the list. This is the name you provide when you create the list.

    listsubid

    Rarely used. ID number associated with subscriber's membership to a list.

    member_addr

    CAN-SPAM business address.

    member_busname

    CAN-SPAM business name.

    member_city

    CAN-SPAM business city.

    membercountry

    CAN-SPAM business country.

    memberid

    ExactTarget Account ID.

    memberpostalcode

    CAN-SPAM business postal code.

    memberstate

    CAN-SPAM business state.

    _messagecontext

    Provides a way to display different content based on the channel (browser, email client, etc.) in which the content is viewed. For example, if content is being viewed through a browser in a landing page, that content can be more robust and formatted differently because you are not constrained to an email client. Possible message context values include:

    • FTAF
    • LANDINGPAGE
    • SEND
    • VALIDATION
    • VAWP
    • PREVIEW
    • LINKRESOLUTION
    • VIEWSENT

    _messagetypepreference

    Resolves to text or to HTML, according to the subscriber's email type preference.

    _replycontent

    Used in triggered sends to place the body of an email into a reply email.

    profile_center_url

    Profile Center URL personalization string.

    replyname

    Reply name for the email send.

    replyemailaddress

    Reply email address for the email send.

    subscriberid

    An ExactTarget-defined unique identifier for each subscriber.

    _subscriberkey

    Used as a unique identifier of the subscriber.

    subscription_center_url

    Subscription Center URL personalization string.

    unsub_center_url

    Unsub Center URL personalization string.

    xtday

    Day when the email is sent (for example, 22).

    xtdayofweek

    Day when the email is sent (for example, Thursday).

    xtlongdate

    Date when the email is sent in long format-for example, Monday, August 11, 2008.

    xtmonth

    Full name of the month during which the email is sent.

    xtmonthnumeric

    Current month (as number).

    xtshortdate

    Date when the email is sent in short format-for example, 8/11/2008.

    xtyear

    Year when the email is sent.

    view_email_url

    View as webpage URL personalization string.
     


    This page was last updated by Ryan Williams on Tue, 07 Feb 2012 14:06:58 GMT.

    If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Ryan direct feedback, fill out the form below:

     


    Was This Page Helpful?
    Suggestions or Comments:
    Name (optional):
    Email Address (optional):
    Enter 18565 backwards:
       
    Tags: (Edit tags)
    • No tags
     
    Comments (0)
    You must login to post a comment.

     
    Powered by MindTouch 2010
    Admin