AMPscript is Marketing Cloud's proprietary scripting language for advanced dynamic content in emails, landing pages, SMS, and push messages.
AMPscript may contain comments or non-executed notes that allow you, as the author, to document your code. You must open comments with the /* sequence and close comments with the */ sequence. Comments may span multiple lines.
Along the same lines, the order of operations for AMPscript is often overlooked. The order starts with the email preheader, then the HTML body, then the text body, and then the subject line.
Inline AMPscript provides a convenient method of interpreting and executing a function within message content. Unlike AMPscript blocks, inline AMPscript can only be used with a single function, and the function output is displayed where the inline AMPscript code appears. However, nested functions are supported.
AMPscript is a scripting language in Salesforce's Marketing Cloud. This script can be implanted on landing pages, SMS messages, text emails, and HTML emails. You can also use it on push notifications which you can get from MobilePush. It can also interact with your data extensions.
AMPscript is added to handle inline personalization of emails, including email interactivity, from basic image carousels to ratings, dynamically updated content, and even advanced calls back to your server. AMPscript is best suited to handle a use case where each email subscriber needs to see unique content.
The amp-bind component enables custom stateful interactivity on AMP pages. For performance, and to avoid the risk of unexpected content jumping, amp-bind does not evaluate expressions on page load. This means visual elements should be given a default state and not rely on amp-bind for initial render.
< script async custom-template = "amp-mustache" src = "https://cdn.ampproject.org/v0/amp-mustache-0.2.js" > </ script > The amp-mustache is used with components like amp-list or amp-form to pass a JSON file. Importing amp-list component into the header.
Amps are special modular weapons used by Tenno Operators to enhance their combat capability, which can be acquired from The Quills and Vox Solaris.
iif(condition,true,false) - Output can be stored in a variable
if - simple conditional statement
It can be done using any of the below options:
- Manually select the subscriber under 'All Subscribers'Journey builder
Automation
String-based identifier enclosed in a delimiter (%%), which can be included in messages or landing pages. There are two types -
Attribute Strings - Derive the values from a field in a data extension or an attribute related to Contact or Subscriber.
System Strings - System-defined strings which display output based on the context of contact or subscriber.
Example - emailaddr, MOBILE_NUMBER, etc.
Standard - This is a basic one, which is used to create a new data extension and to include the fields as needed
Filtered - Select an existing data extension and filter out the records by defining a criteria
Random - Select a percentage or number of subscribers from a source data extension
AMPscript is mainly used for Personalization. It is easy to learn and includes simple if-else statements.
SSJS is for Integrations and to handle JSON requests/responses effectively.
SELECT j.JobID, j.EmailName, o.EventDate, s.EmailAddress, s.SubscriberKey
FROM _job j JOIN _open o on j.JobID = o.JobID
JOIN _subscribers s on o.SubscriberID = s.SubscriberID
WHERE o.IsUnique = 1 AND o.EventDate > dateadd(d,-30,getdate())
Sender profile - Includes the 'From Name' & 'From Email'
Delivery Profile - Specify the IP address to use, physical mailing address mentioned at the bottom of an email
CAN-SPAM classification
Commercial
- Includes promotions or advertisements to promote the products or services
- Must include an unsubscribe mechanism
Transactional
- Transactional in nature. Example - Password reset, Transaction receipts, etc.
- Optional to have an unsubscribe feature
Use AMPscript functions - CreateSalesforceObject, UpdateSingleSalesforceObject & RetrieveSalesforceObject