AMPscript EndImpressionRegion (Next)
Close an impression tracking region with AMPscript EndImpressionRegion in Marketing Cloud Next. Syntax, examples, and behaviour proven in a Marketing Cloud Next email, including the boolean, string and number forms of the optional argument.
Syntax
EndImpressionRegion([endAllRegions]) → string
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
endAllRegions |
string | boolean | number | No | A truthy value ends every open region; the default ends only the most recent |
Example
%%[ BeginImpressionRegion("nav-region") ]%%A%%[ EndImpressionRegion(0) ]%%B
Renders AB. Neither call adds anything to the email.
Return value
string — an empty string. The call leaves no visible trace in the rendered email.
Behaviour
It emits nothing. BeginImpressionRegion("ProbeRegion"), then Y, then EndImpressionRegion(1) renders Y. Text on either side of the call ends up adjacent.
It works without an open region. EndImpressionRegion() on its own, followed by Z, renders Z.
The argument accepts several spellings. The number 0 and 1, the boolean true and the string "true" all render cleanly: A%%[ EndImpressionRegion(true) ]%%B and A%%[ EndImpressionRegion("true") ]%%B both give AB.
Which regions get closed was not tested in Next. The difference between ending one region and ending all of them only shows in impression tracking, which a preview email does not produce.
Show Next test script
<!-- Marketing Cloud Next test script for EndImpressionRegion. Paste it into the HTML component of a
Next email and open the preview. Each line prints the result Next gave when the call
was rendered on its own (expect) next to the result of this run (got).
Assembled from single-call test emails (dates on the page); it has not been
run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[Y] got=[%%[ BeginImpressionRegion("ProbeRegion") ]%%Y%%[ EndImpressionRegion(1) ]%%]</p>
<p>c2 expect=[Z] got=[%%[ EndImpressionRegion() ]%%Z]</p>
<p>c3 expect=[AB] got=[%%[ BeginImpressionRegion("nav-region") ]%%A%%[ EndImpressionRegion(0) ]%%B]</p>
<p>c4 expect=[AB] got=[A%%[ EndImpressionRegion(true) ]%%B]</p>
<p>c5 expect=[AB] got=[A%%[ EndImpressionRegion("true") ]%%B]</p>
Differs from official docs
- Documented as unavailable in Next, yet accepted. The reference’s availability table says No for Marketing Cloud Next. In a Next email every form tested (no argument,
0,1,true,"true") saved and rendered, adding nothing to the output. Which regions get closed was not tested. Card
Availability & differences
| Platform | Available |
|---|---|
| Marketing Cloud Engagement | Yes |
| Marketing Cloud Next | Yes, from API 68.0 |
Every form tested renders the same on both platforms: the call adds nothing, with no argument or with 0, 1, true or "true". Compared 2026-11-23 by rendering the same calls in a Marketing Cloud Next email.
See also
BeginImpressionRegion— opens the region this closes- Official reference