Tagging your Transactional Email emails lets you easily search activity, compare stats, and more. Add tags to emails using sending API calls, custom SMTP headers, or manage tags manually.
Add Tags in Your Transactional Email Account
- Go to Outbound.
- Choose Tags.
- Enter the name of your tag, then click Add Tag.
Delete Tags
- Go to Outbound.
- Choose Tags.
- Find the tag you want to remove and click Delete.
- In the window that appears, confirm removal by clicking Yes, delete the tag.
Deleting a tag also deletes all aggregate stats collected for the tag. Deleting a tag cannot be undone. If new emails are sent with the same tag, that tag will be recreated—you'll need to make sure you've stopped sending with the tag before deleting.
Use the Tags calls to manage tags via the Transactional API.
Add Tags in Your API Request
Transactional Email creates tags for you automatically when you've included them in your sending API call. In this example, Transactional Email will add "order-confirmation" and "order-shipped" to your list of tags if they don't exist already:
"tags": [
"order-confirmation",
"order-shipped"
],
Add Tags Using Custom SMTP Headers
We'll create tags for you automatically when you include them in your email using the custom SMTP header, X-MC-Tags
.
System-Generated Tags
We'll also tag emails for you based on sender, template used (if any), and API key. Filter your Outbound Activity by these system tags using the Tagged drop-down menu.
Search Activity by Tags
Use the search query, tags:tagname
, to filter activity based on tags included for your emails, or select a single tag using the Tagged drop-down menu on the Outbound Activity page.
Tags vs. Custom Metadata
Tags are great for broad categories of messages like welcome or forgot-password emails. The content for these emails may vary, but the tag can help track data like opens and clicks for that type of email over time.
Metadata is generally better for managing more user-specific information like a 'user id' from your system, for example. Metadata information is returned in webhooks and searchable in Outbound Activity for your Transactional Email account, so you can tie certain information back to data in your own system.
Tag-based stats are kept indefinitely, while metadata stats are not. Use the View Stats By drop-down menu to filter overall stats on the Dashboard in your Transactional Email account, or by using the tags API calls.
Note
Stats are accumulated using tags, but Transactional Email stores only 100 tags per account (not including system-generated tags), so this should not be unique for every message or change often.
Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and cannot be used.