Programmatic Languages35% of the exam

Defensive AMPscript coding and language choice

When to choose AMPscript or SSJS and why not to mix them, plus the habits that keep scripts from failing: AttributeValue(), fewer lookups, upserts instead of inserts, sanitized TreatAsContent() input, content-block fallbacks, URL encoding, testing, NotSent and View as a Web Page.

Official exam objective
Implement standard development best practices using Marketing Cloud programming languages.

~7 min read · 14 practice questions ·

What the exam expects

  • Choose AMPscript or SSJS for a requirement, and keep one language per new landing page.
  • Separate browser-side JavaScript from server-side code on a CloudPage.
  • Write scripts that survive missing attributes, missing content blocks, duplicate keys and unsafe input.
  • Reduce data extension calls and encode values placed in links.
  • Test scripts, find why messages didn't send, and keep View as a Web Page faithful to the sent message.
  • Key terms: Platform functions (SSJS functions for messages, landing pages and applications); Core library (SSJS functions for landing pages and applications); AttributeValue() (a safe attribute read that returns null); NotSent tracking extract (the list of messages that didn't send, with reasons).

Key facts

Email language
Detail
AMPscript or Platform SSJS; Core only on landing pages and apps
Mixing languages
Detail
Possible but not encouraged; one language per new landing page
SSJS limits
Detail
No DOM, no external libraries
Missing attribute
Detail
AttributeValue() returns null instead of failing
Email writes to the send's data extension
Detail
Use UpsertDE(); InsertDE() hits a duplicate key
InsertData() failure
Detail
500 error on duplicate key or missing required column
ContentBlockByKey() default
Detail
Errors on a missing block; status -1 when not found
URLEncode() defaults
Detail
Only spaces in a parameter string become %20
Why messages didn't send
Detail
NotSent tracking extract, with reasons
View as a Web Page
Detail
Reference the send's BatchID
Sources for this section (8)
  • Why should AttachFile() be added to a message with care even when the feature is enabled?
  • When does UpsertDE() leave the data extension unchanged and return 0?
  • What does a ContentBlockByKey() status code of 0 mean?
  • When does URLEncode() convert non-ASCII characters in a parameter string?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Marketing Cloud Engagement Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 25 lessons of the Marketing Cloud Engagement Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (14 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Choose guide-only, practice-only, or save $4 with both

Practice for the Marketing Cloud Engagement Developer exam