---
schema_version: "1"
id: 764e71f49b4644f20134ae66bde8da0baf4a25a48938a4375051002ca42b702f
title: Create a Code Resource
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_cp_use_a_code_resource.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_cp_use_a_code_resource.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b0174382f12b9c8df28f835b74e1efbe96501a100aa3607d1e4fa59967e60daa
description: To add styles or functionality to CloudPages content, such as custom CSS or JavaScript, create a code resource. After you create and publish the code resource, work with a Marketing Cloud Engagement developer to apply it to content using AMPscript.
products:
  - Marketing
  - Marketing Cloud Engagement
release: "264"
---
# Create a Code Resource

To add styles or functionality to CloudPages content, such as custom CSS or JavaScript, create a code resource. After you create and publish the code resource, work with a Marketing Cloud Engagement developer to apply it to content using AMPscript.

A code resource can support CSS, JSON, JavaScript, RSS, XML, or text.

1. Open or create a CloudPages folder, and create a code resource.
2. Enter a name and an optional description.
3. If the private domains feature is enabled, define the URL settings.
4. Select a resource type.
5. Paste your code into the field.
6. To customize the code, use the personalization and merge fields in the toolbar.
7. Save your work.
8. To make the code resource available in CloudPages, publish it.

#### See Also

- [Knowledge: CloudPages Security Best Practices](https://help.salesforce.com/s/articleView?id=002743057&type=1&language=en_US)