Personalization Strings and AMPscript

Use system personalization strings when building AMPscript expressions. For example, to display a different message or text based on the day of the week or the month. Use these personalization strings to add that information:

Other common uses for system personalization strings include passing identifiers, such as the unique email, job, or subscriber ID or 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 example shows invalid AMPscript:

This format displays valid AMPscript:

This section lists the system personalization strings to insert into a message. Type these fields directly into the HTML of your email body if you create an HTML paste email, or you type them directly into the text editor when you create or modify the text of a content box.

  • The system treats all personalization strings as 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). Here's an example of a personalization string used in email:
  • When working with personalization strings inside an AMPscript block, don't use the two sets of double percent symbols. Here's an example of a personalization string within AMPscript:

Review Personalization Strings for the full list of personalization strings available to use within your AMPscript.

Use these personalization strings in conjunction with the MobileConnect and Contact Builder applications inside Marketing Cloud:

Personalization StringDescription
_CarrierIDCarrier ID associated with the contact, contained in the contact CarrierID field.
_ChannelChannel associated with the contact, contained in the contact Channel field.
_CityCity associated with the contact, contained in the contact City field.
_ContactIDContact ID associated with the contact, contained in the contact ContactID field.
ContactKeyContact key associated with the contact, contained in the contact ContactKey field. Used to send SMS messages in MobileConnect. This personalization string works for MT messages but not for MO messages, such as the custom STOP keyword.
_CountryCodeCountry code associated with the contact, contained in the contact CountryCode field.
_CreatedByThe entity that created the contact, contained in the contact CreatedBy field.
_CreatedDateThe date on which the contact was created, contained in the contact CreatedDate field.
_FirstNameThe contact first name, contained in the FirstName field.
_IsHonorDSTIndicates whether the contact's time zone honors Daylight Savings Time, contained in the contact IsHonorDST field.
_LastNameThe contact last name, contained in the contact LastName field.
_MobileNumberThe contact mobile number, contained in the contact MobileNumber field.
_ModifiedByThe last user to modify contact information, contained in the contact ModifiedBy field.
_ModifiedDateThe last time a process modified contact information, contained in the contact ModifiedDate field.
_PriorityThe priority to use when sending a message to a contact, contained in the contact Priority field.
_SourceThe source of contact information, contained in the contact Source field.
_SourceObjectIDThe object ID of the source of contact information, contained in the contact SourceObjectID field.
_StateThe state associated with a contact, contained in the contact State field.
_StatusThe send status associated with a contact, contained in the contact Status field.
_UTCOffsetThe time offset from UTC associated with a contact, contained in the contact UTCOffset field.
_ZipCodeThe ZIP code associated with a contact, contained in the contact ZipCode field.