---
schema_version: "1"
id: 144b1d36252970e895b6b23f503ac96027f67cda70f10c860b891b02c43a6b18
title: ContentAreaByName
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_utilitiesContentAreaByName.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_utilitiesContentAreaByName.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a23ea11774b89d187f49a6b9785a328aa091401f96d01e245d0fc0fe73fe9e44
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# ContentAreaByName

Returns the content stored in the specified content area.

## Syntax

`ContentAreaByName(1, 2, 3, 4)`

## Properties

| Ordinal | Type   | Description                                                                      |
| ------- | ------ | -------------------------------------------------------------------------------- |
| `1`     | String | Required. The name of the content area.                                          |
| `2`     | String | The name of an impression region that’s contained in the specified content area. |
| `3`     | String | The error message to deliver if the function can’t return content.               |
| `4`     | String | The content area to display if the function can’t find other content.            |

## Example

In this example, the variable gets the information from the specified content area. The content isn’t written to the email or landing page you create. Instead, the content resides in the variable for use as any other string.

```
var myContent = ContentAreaByName("myContentArea");
```

Combine this function with the `Write()` function to output the content area in your message or site.

```
<script runat="server">
  var myContent = ContentAreaByName("myContentArea");
  Write(myContent);
</script>
```

## See Also

- [Write()](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_utilitiesWrite.md)
