As AMPscript is a server-side language, the code can be included in any location in an email, web page, SMS or push message. Similar to other scripting languages, AMPscript is interpreted and not compiled, which means that it’s interpreted in the order it is written. So if you are using AMPscript to include personalized content in an email, the AMPscript code will need to be defined before or at the point where the personalized content should appear.

AMPscript code is contained within a character sequence that opens and closes with double percentage marks (%%) and either contains an inner bracket delimiter ([ and ]), for AMPscript blocks, or an equality character (=), for inline AMPscript. All AMPscript code must be surrounded by matching opening and closing delimiter patterns, otherwise the code will be ignored.