---
schema_version: "1"
id: d68b11fc7abf61fd69f3e66bf23705a3d2559b62e9be85bcba0f968c2a22654b
title: Create a Code Snippet
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mc_ceb_create_code_snippet.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mc_ceb_create_code_snippet.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 740312c32119b479f788ef4442d633c734e639ef0b29236edcd2bb72bc51b871
description: Use code snippets in Marketing Cloud Engagement Content Builder to save reusable bits of HTML, AMPscript, and Guide Template Language. Insert snippets when editing HTML via the Code Snippets toolbar selector, or by typing the Customer Key value for the snippet followed by the Tab key. You can also create a code snippet content block by clicking Create > Content Blocks > Code Snippet. You can reference Code Snippets with the AMPscript ContentBlockByKey and ContentBlockByID functions.
products:
  - Marketing
  - Marketing Cloud Engagement
release: "264"
---
# Create a Code Snippet

Use code snippets in Marketing Cloud Engagement Content Builder to save reusable bits of HTML, AMPscript, and Guide Template Language. Insert snippets when editing HTML via the Code Snippets toolbar selector, or by typing the Customer Key value for the snippet followed by the Tab key. You can also create a code snippet content block by clicking **Create > Content Blocks > Code Snippet**. You can reference Code Snippets with the AMPscript ContentBlockByKey and ContentBlockByID functions.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_content_creation-264-0-0-production-enus/453b15fc-ab47-40df-8f11-8a7b92c8d0cd/images/icon_note.png)

Note Code snippets behave like content blocks but are different because they don’t include an extra HTML table that wraps the content.

Follow this task to create a code snippet in the editor.

1. In the Content Builder editor, highlight the HTML you want to use as a code snippet.
2. Click ![code snippet](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-mc_content_creation-264-0-0-production-enus/453b15fc-ab47-40df-8f11-8a7b92c8d0cd/mc_content_creation/images/snippet.png) from the toolbar menu and select **Create New Snippet**.
3. Alternatively, highlight your HTML, then right-click and select **Create Code Snippet**.
4. Complete the fields and click **Save**. To edit a saved code snippet, select the code snippet from the content library and click **Edit**.

- **[Google Promotions Tab](https://help.salesforce.com/s/articleView?id=mktg.mc_ceb_google_promotions_tab.htm&release=264.0.0&type=5)**  
    Learn how to use a Google Promotions Tab code in Marketing Cloud Engagement Content Builder to enhance your email promotions with images, deals, expiration dates, and more.