AMP Script Interview Questions and Answers
by Sachin, on Jul 4, 2022 8:12:58 PM
Q1. What is AMP scripting?
Ans
AMPscript is Marketing Cloud's proprietary scripting language for advanced dynamic content in emails, landing pages, SMS, and push messages.
Q2. How do you set variables in AMPscript?
Ans
- SYNTAX – VAR. VAR @variablename. VAR @firstname, @secondname, @thirdname.
- SYNTAX – SET. SET @variablename = “value”
- SYNTAX – V() %%=v(@variablename)=%%
Q3. How do you comment code in AMPscript?
Ans
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.
Q4. In what order is AMPscript evaluated before an email is sent?
Ans
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.
Q5. What is inline AMPscript?
Ans
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.
Q6. What is an AMPscript Salesforce?
Ans
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.
Q7. How can AMPscript customize email messages?
Ans
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.
Q8. What is AMP bind?
Ans
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.
Q9. What is AMP-mustache?
Ans
< 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.
Q10. What are some functions you can perform with AMP script?
Ans
- Personalize emails using subscriber or contact data.
- Create complex, highly dynamic emails using conditional logic.
- Clean and format data.
- Add real-time information to emails such as date or time.
- Track impressions.
Q11. What is an AMP Warframe?
Ans
Amps are special modular weapons used by Tenno Operators to enhance their combat capability, which can be acquired from The Quills and Vox Solaris.
Q12. How do you download the policy from the dashboard?
Ans
- Log into the Dashboard
- Go to Settings > Script Manager
- Select the target script
- Click View Code to review (optional)
- Select Download Script
Q13. How do you edit an AMP file?
Ans
- Launch Automation Manager
- Open the policy
- Click Open Policy File in the North-pane (available when Automation Manager launches), or
- Go to File > Open, or
- Click the Open button in the toolbar
- Navigate and select the target policy to open it in the north Policy Builder pane.
- Change the script
- User the Run or Debug option to test the script and ensure it is working (recommended)
- Click Save
- Upload to the Dashboard via the Script Manager (replace existing or add a new script)
Q14. What is the difference between iif() and if, in AMPscript?
Ans
iif(condition,true,false) - Output can be stored in a variable
if - simple conditional statement
Q15. What are the different ways to Unsubscribe a subscriber?
Ans
It can be done using any of the below options:
- Manually select the subscriber under 'All Subscribers'- Use the LogUnsubEvent property
- Create the Subscriber object using AMPscript
- Feedback loops
- Setup Reply mail management to handle the requests
Q16. What is the difference between Journey builder and Automation studio?
Ans
Journey builder
- - Multiple entry sources
- - Create/update the Sales/Service cloud object records
- - Einstein-related features
- - Has additional communication channels than Automation Studio
- - More options to interact with the Sales/Service cloud
Automation
- - Involves Data management activities, SSJS Scripts, and FTP
- - Journey can be included as one of the steps
- - Ability to Import reports from Sales/Service Cloud
Q17. What are Personalization strings?
Ans
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.
Q18. What are the different types of data extensions?
Ans
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
Q19. What is the difference between AMPscript and SSJS(Server-Side JavaScript)?
Ans
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.
Q20. Write a Query to display all the 'emails opened in last 30 days?
Ans
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())
Q21. Mention the components of Send Classification.
Ans
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
Q22. How to Create/update/retrieve records to/from the Service cloud?
Ans
Use AMPscript functions - CreateSalesforceObject, UpdateSingleSalesforceObject & RetrieveSalesforceObject