Salesforce Marketing Cloud (SFMC) is one of the most popular cloud-based digital marketing platforms, providing marketers a fully integrated solution for developing robust campaigns and customer journeys - incorporating the use of email, mobile, social media, and personalization through data and analytics. Email Studio, the home to Content Builder, subscribers, data and analytics, provides marketers with a powerful suite of easy-to-use tools and the ability to customize all aspects of an email marketing strategy.
Salesforce Marketing Cloud Modules offer user-friendly “out-of-the-box” features, like customizable mobile-responsive templates, content blocks, drag-and-drop data filters, and a useful A/B testing tool, which are perfect for new customers and those just getting started. Salesforce integrated users can take things a step further, incorporating custom reports and data from the Sales Cloud into Email Studio to use with marketing automation and real time triggered sends using Marketing Cloud Connect.
Email marketing strategies come in a variety of shapes and sizes, all determined by a myriad of combinations of content, products, subscribers, customers, metrics, data, and many more. With all these factors contributing to the success or failure, plus new trends and innovation happening all the time, it can be quite challenging finding any place to start.
Email Studio was designed with all types of marketers in mind, providing users intuitive tools for content creation, subscriber management, tracking, plus more advanced capabilities for the tech savvy user, like AMPscript - a scalable scripting language developed solely for use in Salesforce Marketing Cloud. The key to making the most of these features is by gaining a thorough familiarity with Salesforce sales cloud basics.
Whether starting from scratch, rethinking, relaunching, or focusing on improving upon recent success, there is a tremendous amount of time, effort, and energy required along the way. The road to email marketing success has many paths, and hinges on numerous factors and decisions made over the course of time. The key to success and navigating through all these scenarios is the ability to envision, execute, and engage.
Do you have a solid email strategy, or are you in the process of figuring one out? With Email Studio, the possibilities are endless. If you’ve never been able to bring your email dreams to life, Email Studio will give you a fantastic starting point. Users of all levels will see the immediate opportunities Email Studio provides to manifest their vision. Users new to Salesforce Marketing Cloud documentation can use drag-and-drop email creation and data filtering tools to create engaging emails and target audiences. Advanced and technical users can use Data Extensions and Tracking to combine engagement metrics and data with customized offers and promotions.
An email marketing plan is only as good as your ability to implement it. The right tool can extend your capabilities far beyond what you thought was possible. There’s a lot that goes into implementing a successful email marketing strategy, and Email Studio allows you to manage that in a single location. Your creative team can handle everything from uploading images to HTML design. Database administrators can work on integrating external data and information through Data Extensions and Data Relationships. Marketing Managers can use the drag-and-drop functionality of Data Filters to identify custom segments and audiences while creating stunning emails in Content Builder. Analysts can utilize dozens of report options and tracking information to measure the success and effectiveness of email campaigns. All this can be done simultaneously in Email Studio, to bring your email marketing vision to life.
Is success measured by clicks, conversions, or monetization? Knowing the endgame is crucial for establishing the vision and execution of your email marketing strategy. Are your emails full of imagery, content focused, or somewhere in the middle? Email Studio offers a wide range of capabilities that allows you to focus on the relationship between content and data, and the mix to give you measurable results.
Every company has a vision and story to tell. Email has evolved from filling a single message with as much text and imagery as possible to communications that are more refined, interactive, and ultimately engaging. There are a multitude of aspects to consider when designing and building your email templates and campaigns — sender name, subject lines, preheaders, image to copy ratio, animation, live content, and many more. Each can have a major impact on the success or failure of your strategy. Having the ability to optimize each component of your message will lead to more effective marketing campaigns and engaging messaging that will increase conversions and ROI.
Content Builder is the Marketing Cloud’s cross-channel content management tool that consolidates images, documents, and content in a single location within Email Studio. It features an easy-to-use drag and drop interface and meticulously coded email templates built for newsletters, promotions, and e-commerce.
Marketers often have several objectives to conquer, and need to manage everything from design, style, imagery, copy and call to action. Most emails fall into one of the following campaign types:
Once you know the type of emails you need to create, there are several factors that are at the core of successful email campaigns:
The process of creating an email in Email Studio starts with choosing the type of email you need to create. There are three types of emails that can be created:
Basic: | Templates that include coded content blocks for you to upload and arrange your creative assets in a framework consisting of hero image, 1-2-3 columns, and sidebar options. |
---|---|
Empty: | Provides a simple framework for creating an email from scratch in a mobile-responsive format. |
Themed: | CSS-based HTML templates developed for marketers without design resources. These templates are designed with a purpose, consisting of options for businesses, newsletters, retailers, and many others. Each template is developed in accordance with best-practices and allows users to customize fonts, colors, content, and images. |
Content blocks allow you to create reusable content modules that can be dragged-and-dropped into Template emails or inserted into HTML Paste emails using AMPscript. Content blocks can be categorized into one of five main types:
Email Studio also comes with Social Forward, creating a streamlined process that allows you to easily integrate your social media channels in all your email campaigns. Your recipients can share content through their social media channels with friends, family, and followers. Social Forward also tracks any clicks from an email to a social network and the resulting page views from the URL shared by the email recipient. It supports direct linking to designated social networks or the use of a third-party service like ShareThis.
Engagement metrics and other email KPI’s are the source for identifying, analyzing, and optimizing your email campaign strategy. They are used to track email performance, identify behaviors, and monitor opens, clicks, and conversions. Using the SFMC conversion tracking module will allow you to stay on top of these metrics.
The standard Tracking Report in Email Studio compiles all the relevant data and statistics into an intuitive dashboard that can be downloaded and shared across your organization. Tracking Report data is organized into the following KPI’s:
Email Studio also comes packed with dozens of report templates you can easily configure and download or set up scheduled reporting to have each report update daily, weekly, or at any interval, which you can then download or transfer to internal systems. There are four report types, each has multiple options for finding the data you need for success:
Once you dig deeper into the data, you will be able to adjust your strategy based on what’s working and what’s not. You can analyze demographic, behavioral, and contextual data to optimize current emails or devise a new strategy.
Contacts, prospects, leads, opportunities, subscribers and customers: these are the various ways you can view your target audience. Whether you sell products or services, or are trying to generate traffic or brand awareness, this segment encompasses all of the different types of people you need to reach to have a successful email marketing strategy. The strategy of mass emails or “batch and blast” is long gone, and your audience is looking for direct and personalized communication from you. Showing that you know who they are will go a long way in creating loyal and engaged subscribers and customers with a personalized experience.
Email Studio provides two different data models for building a database centered on profile, preference, and behavioral information. The list model allows marketers to easily manage subscriptions and profile fields. The relational model (Data Extensions) offers a completely customized way to integrate data from one or many data sources. This creates a unified data architecture with scalability that can evolve over time. Data management tools allow marketers to filter, segment, and create relationships from both models, with the flexibility to execute them seamlessly.
Knowing “who” to send your email campaigns is only half the battle. Identifying this target audience requires utilizing a multitude of data and information to develop a unique and personalized experience. A “persona” is a generalized representation of your audience segment, used to create a personalized email marketing strategy. Understanding the “who”, “what”, “how”, and “why” of your audience provides you the greatest opportunity to develop a true 1:1 communication.
Choosing the appropriate data model is the first step to developing a data architecture that can support your current email marketing needs and grow as you do. Email Studio consists of two data architectures you can choose from, Lists and Data Extensions. There are many factors that go into selecting the correct data model:
Data Model | List Data Model | Data Extension Data Model |
---|---|---|
Subscribers | 500,000 or less long term | 500,000 or more long term |
Attributes | Limited number of attributes | Unlimited fields and data types |
Processing | Slower import speed | Fast import speed |
Integration | XML API | SOAP or REST API |
Usability | Simple and easy to use | Flexibility and greater performance |
Data Extensions offer a relational database structure perfect for integrating multiple data sources like Salesforce, CRM, CMS, e-commerce, and many more. Data Extensions are database tables that hold certain types of data and information related to other types of data and information, based on a specific value or association. Data Extensions use a unique identifier called a Primary Key, used to “join” data from one Data Extension to another, based on one or more field or value. The unified data structure allows management of each data source individually through import/export, automation, or API calls. Additional features and functionality that could factor into your decision include:
Functionality | List Data Model | Data Extension Data Model | ||||
---|---|---|---|---|---|---|
Data Management |
|
|||||
Web Collect |
|
|||||
Data Types |
|
|||||
Primary Key |
|
|||||
Data Retention |
|
|||||
Sharing |
|
|||||
Queries |
|
|||||
Profile Center & Subscription Center |
|
Whichever data model you choose, make sure to weigh your options carefully and also plan for the future.
There is a multitude of data that can be used to create targeted segments and audiences for your email campaigns. Any combination of demographics, behavior, engagement, or purchases can be leveraged to build these in a number of ways:
A Data Filter is a series of criteria that is used to segment a subscriber list or data extension based on one or more profile or preference field(s). They can be used to apply simple AND/OR statements and complex multi-parenthetical segmentation rules, making it easier for you to precisely target your message to a specific audience.
Data Filters are integrated with both data models, so you can segment by Profile fields when using the List model or by Data Extension when using the relational model. Using the drag-and-drop feature, you can easily add or remove attributes to define the filter criteria. All criteria are organized using AND or OR statements, as well as combining multiple statements together to create a more sophisticated set of rules.
AND statements |
Membership Status is Active AND Membership Date is after 1/31/2019 |
OR statements |
Membership Class is Bronze OR Membership Class is Silver |
AND/OR statements |
Membership Status is Active AND Membership Date is after 4/30/2019 AND (Membership Class is Bronze OR Membership Class is Silver) |
All Profile and Data Extension fields are available to use when creating Data Filters. It is important to keep in mind what data type each field is and how that data is collected and stored in each field. There is an extensive list of operators you can choose from, which gives you the opportunity to add as much specificity to the filtering criteria you need. Operators are broken down into five categories:
Text | definition that exactly matches the valueor string of characters - “ is equal to”, ”is not equal to”, ”begins with” ,”contains”, ”does not contain”, ”ends with”, ”exists in”, ”does not exist in” |
Numerical | operators used when an attribute is a numeric value - “is greater than”, “greater than or equal to”, “is less than”, “less than or equal to” |
Attribute | includes or excludes attribute values that match the exact sequence of characters used for comparison - “begins with”, “ends with”, “contains”, “does not contain” |
Value | criteria that matches one or more of the values you defined in a comma delimited string. This operator looks for a partial match of the entire value - “exists in”, “does not exist in” |
Null | returns or excludes results that are blank for the field selected - “is empty”, ”is not empty” |
A data relationship is used to combine one or many data sources to create a singular view of all profiles and preferences from each data source. The relationship specifies a field contained in one data extension that corresponds to a similar field of the same name or type in another data extension or in a subscriber attribute. Data Filters can then be applied to enhance segmentation by utilizing all fields joined through the relationship.
Measures are used to define data based on behaviors and engagement from utilizing email performance and campaign events. They are comprised of a data source (subscribers), an event source (opens), and criteria (campaign and event attributes). Once a measure is created, it can be combined with criteria already existing in Data Filters, providing enhanced targeting capabilities.
Email Studio comes with a number of preconfigured Measures, based on Send, Open, Click, Bounce and Unsubscribe data.
Data Filter with Measure | |
---|---|
Data Filter | Membership Status is Active AND Membership Date is after 1/31/2019 AND (Membership Class is Gold OR Membership Class is Platinum) |
Measure | Open Date is equal to today minus 3 days |
Content | We miss you! Come back and SAVE 10% |
NOTE: Measures will only evaluate the past 6 months of event data.
With so many factors to contend with, gaining visibility in the inbox can be a daunting task. Expectations are high for you to deliver compelling content that is both relevant and timely. Personalizing email campaigns is a proven way to increase your open and click rates, leading to a measurable impact on conversion and ROI. It has evolved from simply inserting some basic profile and demographic information to combining preferences, behaviors, engagement, and purchases into a cohesive and streamlined communication strategy.
Email Studio provides the tools and capabilities to implement these tactics in a variety of ways. Personalization strings allow for the integration of message, recipient, sender, and campaign data with tracking and analytics. AMPscript is a scripting language that can be embedded in HTML and text emails. Email Studio processes the script to render content at send time on a subscriber-by-subscriber basis.
“One-size-fits-all” messaging has been replaced with the expectation of relevant and personalized content and experiences through all marketing channels. Leveraging data and information from the personas you developed (“who”, “what”, “how”, and “why”) provides you the greatest opportunity to develop a true 1:1 communication that drives revenue and results.
Who | Background, demographics, profiles, and survey data |
What | Products, services, and information |
How | Content, messaging, images, animation, and social media |
Why | Drive sales, increase conversions, generate greater ROI |
Mixing and matching data may seem an overwhelming task, but Email Studio provides endless possibilities for aggregating content and creating scalable data models in a single platform to move from 1: many communications toward 1:1 experience.
Dynamic content involves customizing your email content and images based on your personas, online behavior, purchases, or many other data points. Email templates are coded to display text, HTML and images according to the rules you define, based on the data stored in your relational Data Extensions. Dynamic content takes on the formatting, such as background color and border design, defined for whichever retrieved content is being used.
Dynamic content can be configured in Email Studio using Content Builder:
Block settings | Choose to “Keep content blocks up-to-date” to apply future block edits to emails using the block. Choose to “Make local copies of content blocks” to prevent block edits to emails using the block. |
Default content | Choose to select a content block that will render in the content area if data doesn’t match the criteria or choose to leave the content area blank |
Rules | The criteria that designates what content, if any, is shown when the audience data matches. Rules can be created using Profile fields or Data Extension fields. |
Built using the same logic as Data Filters, Dynamic Content rules are organized using AND or OR statements.
Dynamic Content AND statement | |
---|---|
Rule | Membership Status is Active AND Membership Date is after 1/31/2019 |
Content | We miss you! Come back and SAVE 10% |
Dynamic Content OR statements | |
---|---|
Rule | Membership Class is Bronze OR Membership Class is Silver |
Content | Don’t wait - upgrade to GOLD status now |
Dynamic Content AND/OR statements | |
---|---|
Rule | Membership Status is Active AND Membership Date equals today minus 5 days AND (Membership Class is Bronze OR Membership Class is Silver) |
Content | Upgrade to GOLD within 5 days of joining for only $49 |
AMPscript is the proprietary content scripting language for Marketing Cloud, which enables you to define specific content based on almost all of the demographic, behavioral, engagement, product, and purchase data available in Data Extensions. Having a general understanding of scripting languages will make working with AMPscript much easier. However, unlike other scripting languages, it has been developed to specifically run in the Marketing Cloud environment, where it is executed when emails campaigns are triggered or sent.
AMPscript offers a multitude of options to create, store, retrieve, insert, or delete data and content within Email Studio. It can be combined with code developed, supporting integrations to Salesforce, Microsoft Dynamics and additional Marketing Cloud Studios and APIs (Mobile, Social, Cloud Pages, etc). There is extensive documentation and technical resources available that cover all aspects of AMPscript. The core concepts and building blocks for understanding, developing and executing AMPscript within your email campaigns include:
AMPscript syntax | |
---|---|
AMPscript block | %%[FUNCTION(value)]%% |
AMPscript inline | %%=FUNCTION(@variable)=%% |
AMPscript Constant | |
---|---|
Numeric | Numeric constant values consist of an unquoted set of numerals and can also include one decimal point and an introductory minus sign to indicate negative values. Numeric constant values cannot contain commas. |
String | String (or text) constant values must use double or single quotes. String constants can escape the delimiting quote if they appear within the text by doubling it. The system does not recognize alternative quote characters, such as smart quotes. |
Boolean | Boolean constant values must use true or false and are case-insensitive. |
LOWERCASE("{Constant String Text}") [example: LOWERCASE(“Jane Smith”) | |
AMPscript Attribute | Functions and scripts reference subscriber attributes, email attributes, and data extension column values as unquoted strings. If the attribute, data extension column, table, or relationship name includes a space or special character, enclose the value in square brackets. You can define additional email attributes within the email and use them in substitutions or as parameters in AMPscript function calls. The Marketing Cloud must enable the use of additional email attributes for your account. Contact your Marketing Cloud relationship manager with any questions. |
LOWERCASE(First_Name) | |
AMPscript Variable | Declare, initialize, and modify variables within a script. Script statements and functions can then reference variables. A variable declaration consists of the keyword VAR followed by one or more comma-delimited variable names. Variable names must begin with @ and include at least one other letter, number, or underscore. |
LOWERCASE(@FirstName) |
AMPscript Logical Operators | |
---|---|
IF | The IF statement performs conditional processing of a logical statement with one or more criteria. |
ELSEIF | The ELSEIF statement performs subsequent conditional processing within the logical statement if prior criteria are not met. Multiple ELSEIF statements can appear within an IF block. |
ELSE | The ELSE statement performs conditional processing of a logical statement when none of the prior criteria are met. Only one ELSE statement can appear within an IF block. |
ENDIF | The ENDIF statement closes the IF block. Only one ENDIF statement can appear at the end of an IF block. |
|
|
FOR | Allows content within the FOR block to iterate over a variable number of times. |
|
|
OUTPUT | Returns the results of code executed inside a code block and includes the results in the rendered content.
The OutputLine keyword also appends a carriage return and line feed (CRLF) to the end of the resolved
content. Output and OutputLine works with the results of a nested function or script block, and they don't support the passing of direct literals. |
|
Content Area | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Inserts content (text, HTML, AMPscript) contained in the specified stored content area into an email. | ||||||||||||
Content | <p>Upgrade your membership to GOLD for only $50 more</p> |
||||||||||||
Format | %%=ContentArea('1,2,3,4,5')=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript | %%=ContentArea('14')=%% | ||||||||||||
Output | Upgrade your membership to GOLD for only $50 more | ||||||||||||
Advanced |
|
Content Area By Name | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Inserts the content contained in the specified stored content area into an email. | ||||||||||||
Content | <p>Upgrade your membership to GOLD for only $50 more</p> |
||||||||||||
Format | %%=ContentAreaByName(1,2,3,4,5)=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript | %%=ContentAreaByName('My Content\Memberships\Gold Status')=%% | ||||||||||||
Output | Upgrade your membership to GOLD for only $50 more | ||||||||||||
Advanced |
|
Content Block By ID | ||||
---|---|---|---|---|
Overview | Returns content contained in the specified stored content block or code snippet from Content Builder, including the Image Block type. | |||
Content | <p>Upgrade your membership to GOLD for only $50 more</p> | |||
Format | %%=ContentBlockbyId("1,2,3,4,5")=%% | |||
AMPscript | %%=ContentBlockbyId("1121")=%% | |||
Output | Upgrade your membership to GOLD for only $50 more | |||
Basics |
|
Advanced |
|
Content Block By Key | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns content contained in the specified stored content block or code snippet from Content Builder, including the Image Block type. | ||||||||||||
Content | <p>Upgrade your membership to GOLD for only $50 more</p> |
||||||||||||
Format | %%=ContentArea('1,2,3,4,5')=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript | %%=ContentBlockbyKey("Gold_Status_Offer_Banner")=%% | ||||||||||||
Output | Upgrade your membership to GOLD for only $50 more | ||||||||||||
Advanced |
|
Content Block By Name | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns content contained in the specified stored content block or code snippet from Content Builder, including the Image Block type. | ||||||||||||
Content | <p>Upgrade your membership to GOLD for only $50 more</p> |
||||||||||||
Format | %%=ContentBlockByName("1,2,3,4,5")=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript | %%=ContentBlockByName("Content Builder\Memberships\Gold Status")=%% | ||||||||||||
Output | Upgrade your membership to GOLD for only $50 more | ||||||||||||
Advanced |
|
For the following Data Extension AMPscript functions, the below Data Extension will be used to run the script and populate the variables in each example.
Contacts Data Extension CONTACTS_DE | ||
---|---|---|
State | Zip | |
jim@thisisme.com | NY | 11365 |
robert@thesme.com | NY | 11040 |
john@lz.com | NJ | 07030 |
Locations Data Extension LOCATIONS_DE | |||
---|---|---|---|
Region | City | State | Zip |
New York City | New York | NY | 10009 |
New York City | Brooklyn | NY | 11223 |
New York City | Queens | NY | 11365 |
Long Island | Mineola | NY | 11040 |
New Jersey | Jersey City | NJ | 07030 |
Lookup | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Inserts the specified value(s) from a Data Extension, based on the criteria specified in the rule. | ||||||||||||
Format | %%=Lookup(1,2,3,4)=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript |
|
||||||||||||
Output | Visit your local showroom, located in %%=V(@Region)=%%. Visit your local showroom, located in New York City. When the value of Zip is 11223 |
Lookup Rows | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Inserts a rowset from a Data Extension where the field matches the specified value. Specify additional field value pairs as part of an AND clause. This function returns a maximum of 2000 rows. To better control the number or the order of returned rows, use the LookupOrderedRows() function. This limitation enhances script performance. | ||||||||||||
Format | %%=LookupRows(1,2,3,...)=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript |
|
||||||||||||
Output |
|
Lookup Ordered Rows | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Inserts a specified number of rows from a Data Extension. Additional field and value pairs can be added as part of an AND clause. The function returns an empty set when no values match. | ||||||||||||||||||
Format | %%=LookupOrderedRows(1,2,3,4,5,...)=%% | ||||||||||||||||||
Basics |
|
||||||||||||||||||
AMPscript |
|
||||||||||||||||||
Output |
|
Date Add | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns the sum of a date and an integer, along with a timestamp. | |||||||||
Format | %%=DateAdd(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=DateAdd(@today, '1','D')=%% | |||||||||
Output | Tomorrow's date, along with a timestamp. |
Date Diff | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns the difference between two dates. | |||||||||
Format | %%=DateDiff(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=DateDiff(@tomorrow,@today, 'D')=%% | |||||||||
Output | 1 |
Date Parse | |||||||
---|---|---|---|---|---|---|---|
Overview | Returns a DateTime object from a date string.. | ||||||
Format | %%=DateParse(1,2)=%% | ||||||
Basics |
|
||||||
AMPscript |
|
||||||
Output |
|
Date Part | |||||||
---|---|---|---|---|---|---|---|
Overview | Returns a specified part of a date. | ||||||
Format | %%=Datepart(1,2)=%% | ||||||
Basics |
|
||||||
AMPscript | %%=Datepart('5/1/2019','year')=%% | ||||||
Output | 2019 |
Format Date | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Formats a specified string as a date value. | ||||||||||||
Format | %%=FormatDate(1,2,3,4)=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript | %%=FormatDate("2012-10-05 03:21:34.567890", "MMM DD, YYYY", "HH:MM:SS.MMM", "en-US")=%% | ||||||||||||
Output |
Oct 05, 2012 03:21:34.567 Review AMPscript Date and Time Formatting for available values. |
Local Date To System Date | ||||
---|---|---|---|---|
Overview | Converts a local datetime string or object to the system time. | |||
Format | %%=SystemDateToLocalDate(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output | The system returns the local time based on the value contained in the @currentSystemTime variable, then converts it back to system time. |
Now | ||||
---|---|---|---|---|
Overview | Returns the current system date and time. When included in content for triggered sends, the time indicates when the triggered send definition for the message started or republished. The time does not not reflect when the send actually occurred. | |||
Format | %%=Now()=%% | |||
Basics |
|
|||
AMPscript | Given the date and time 10 a.m., March 1, 2014. %%=Now()=%% | |||
Output | 5/1/2019 12:00:00 |
AMPscript Functions for Linking
Redirect To | ||||
---|---|---|---|---|
Overview | Target of a link stored in an attribute, Data Extension, or variable. In order to retain tracking information
for clicked links, you must include the anchor tags () within the email itself and not the link retrieved via
AMPscript. This function only provides tracking information for clickable links within an email message. You cannot retrieve tracking information when using this function with URLs stored in a variable or used as part of a query string parameter. |
|||
Format | %%=RedirectTo(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output |
Find the best membership option for you: Bronze [http://www.memberships.com/bronze] Silver [http://www.memberships.com/silver] Gold [http://www.memberships.com/gold] Platinum [http://www.memberships.com/platinum] |
URL Encode | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Creates the specified URL with spaces replaced with %20 or fully encodes all non-alphanumeric characters. | |||||||||
Format | %%=URLEncode(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript |
|
|||||||||
Output |
|
AMPscript Functions for Strings
Concat | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Concatenates the strings specified in the arguments. | |||||||||
Format | %%=Concat(1,2,...)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=Concat('a','b','c')=%% | |||||||||
Output | abc |
Format | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overview | Formats the value according to the string you specify. | ||||||||||||
Format | %%=Format(1,2,3,4)=%% | ||||||||||||
Basics |
|
||||||||||||
AMPscript |
|
||||||||||||
Output |
|
Lowercase | ||||
---|---|---|---|---|
Overview | Formats the specified value in all lowercase letters. | |||
Format | %%=Lowercase(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output | Jack smith |
Proper Case | ||||
---|---|---|---|---|
Overview | Formats the specified string with the initial letter of each word capitalized. | |||
Format | %%=ProperCase(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output | Jack Smith |
Uppercase | ||||
---|---|---|---|---|
Overview | Formats the specified value in all uppercase letters.. | |||
Format | %%=Uppercase(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output | JACK SMITH |
Replace | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Replaces the first string value with the second string value in the variable. | |||||||||
Format | %%=Replace(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript |
|
|||||||||
Output | The 2019 model is better. |
Replace List | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Searches a string value for one or more string values you specify and replaces those values with another string value. | |||||||||
Format | %%=ReplaceList(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=ReplaceList('ABCDEFG', 'X', 'A', 'C', 'E', 'G')=%% | |||||||||
Output | XBXDXFX |
Substring | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns the portion of the specified string starting with the specified character position and no longer than the specified length. If the specified character position exceeds the length of the specified string, the function returns an empty string. | |||||||||
Format | %%=Substring(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=Substring('abcdef',2,2)=%% | |||||||||
Output | bc |
Trim | ||||
---|---|---|---|---|
Overview | Returns the value of the string parameter with the leading and trailing spaces removed. | |||
Format | %%=Trim(1)=%% | |||
Basics |
|
|||
AMPscript | %%=Trim(' Hello! ')=%% | |||
Output | If @VAR variable is empty: 123 If a value exists in @VAR: @VAR |
AMPscript Function Utilities
Attribute Value | ||||
---|---|---|---|---|
Overview | Returns the value of a subscriber attribute stored in a Profile filed or Data Extension field. | |||
Format | %%=AttributeValue(1)=%% | |||
Basics |
|
|||
AMPscript |
Combined with a Lookup call to get the name of an attribute, you can retrieve an attribute's value and
pass it into a variable.
|
|||
Output | This code retrieves the value of Zip. |
IIf | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Overview | Returns the second parameter if the first parameter evaluates True. Returns the third parameter if the first parameter evaluates False. | |||||||||
Format | %%=IIF(1,2,3)=%% | |||||||||
Basics |
|
|||||||||
AMPscript | %%=IIF(EMPTY(@VAR),'123',@VAR)=%% | |||||||||
Output |
If @VAR variable is empty: 123 If a value exists in @VAR: @VAR |
Output & Output Line | ||||
---|---|---|---|---|
Overview | Returns the results of AMPscript code executed within a code block, such as Concat() or V(), and includes the results inside the rendered content. | |||
Format | Output(1) | |||
Basics |
|
|||
AMPscript |
Combined with a Lookup call to get the name of an attribute, you can retrieve an attribute's value and
pass it into a variable.
|
|||
Output | My output is a success! | |||
Note that the system outputs the CRLF after the string of text. |
V | ||||
---|---|---|---|---|
Overview | Outputs the value of a variable. This is commonly used when a variable is defined within a code block and the result is displayed within the email. | |||
Input | ||||
Format | %%=V(1)=%% | |||
Basics |
|
|||
AMPscript |
|
|||
Output | Hello |
AMPscript can be coded directly in email templates, pasted in HTML emails, or stored in Content Blocks where they can be used within Email Studio. Once you understand the basics and how to construct AMPscript on your own, you can configure the code below to work within your content and data architecture.
Integrating Dynamic Content and AMPscript into an email marketing strategy requires careful planning and preparation. The capability to create endless permutations for your content and audience can be both appealing and intimidating. Personalization shouldn’t come at the expense of being able to effectively create, execute and maintain your email marketing strategy. The goal is to save time and resources through streamlining the production process, not extending it. The right combination of segmentation, dynamic content or AMPscript, and automation will take your email marketing program to the next level.
Extend the power of AMPscript by integrating Salesforce Objects and data into Email Studio with Marketing Cloud Connect. Salesforce Objects work like Data Extensions, with the same AMPscripting capabilities. You can use Contact, Lead, or Account Objects to personalize Triggered Sends from the Salesforce through Marketing Cloud.
Instead of sending generic confirmation emails with, “Mike, your return authorization has been approved,” you can include case specific information in the email to provide additional details and better visibility for your customers “Mike, your return authorization confirmation number is AMZ8612220.”
Additionally, there are Salesforce specific functions that can be performed:
Create Salesforce Object Creates a record in your integrated Salesforce account and returns the ID of the record created. This function works only for an account integrated with a Salesforce account. | |
---|---|
AMPscript | %%[ VAR @NewLead SET @NewLead=CreateSalesforceObject('Lead', 2, 'First_Name', 'Chris', 'Last_Name', 'Smith') ]%% |
Output | Salesforce creates a Lead where the First Name is Chris and the Last Name is Smith. |
1 string | Type of object to create a record in, such as Lead or CustomObject (REQUIRED) |
2 numeric | Number of fields specified to add in the record (REQUIRED) |
3 string | Name of field (REQUIRED) |
4 string | Value of field (REQUIRED) |
Long SFID Returns the 18-character Salesforce ID from a shortened 15-character version. NOTE: When integrating Salesforce records in Marketing Cloud, the 18-character Salesforce ID must be used. The Subscriber Key field in the All Subscribers List is not case sensitive, so records will be deduped if you import using the shortened format. |
|
---|---|
AMPscript | %%[ VAR @LeadID, @CID SET @AccountID = AccountID SET @SFID = LOOKUP(‘SalesforceObjecAccount’,’CID’,’AccountID’,@AccountID) ]%% |
Output | Your account number is %%=LongSFID(@SFID)=%% |
1 string | The 15-character Salesforce ID (REQUIRED |
RetrieveSalesforceObjects Returns a rowset with the selected information from Salesforce objects that match the criteria you specify. This function works only with an account integrated with Salesforce. Include multiple sets of ordinals 3, 4, and 5 to retrieve information as necessary. Because this function returns data as a rowset, use Row() and Field() to evaluate the data. |
|
---|---|
AMPscript | %%[ VAR @Region, @Regional_Managers SET @Region = Region SET @RegionalManagers= RetrieveSalesforceObjects('Managers', 'Region, First_Name, Last_Name, Location', 'Region', '=', 'New York City') ]%% |
Output | Interested in becoming a member? Visit any one of our %%=V(@Region)=%% locations and meet a Sales Manager to learn more: %%Location%%, %%First_Name%% %%Last_Name%% |
1 string | Type of object to retrieve information, such as Lead or CustomObject (REQUIRED) |
2 string | Names of fields to retrieve information, including multiple comma-separated values such as FirstName,LastName (REQUIRED) |
3 string | Names of fields used to match the record for selection as a WHERE clause. Include only one field name for this parameter (REQUIRED) |
4 string | Operator used to compare the fifth ordinal to the third ordinal. = (is equal to) < (is less than) > (is greater than) != (is not equal to) <= (is less than or equal to) >= (is greater than or equal to) (REQUIRED) |
5 string | Value to compare to the third ordinal for record selection. You may add additional name, operator, and value parameters for more complex filtering. This function joins these WHERE clauses with AND only. (REQUIRED) |
Enhanced Dynamic Content
Enhanced Dynamic Content lets you import a delimited file containing text and image URLs to create enhanced dynamic content for emails in Content Builder. Instead of using AMPscript and data extensions to manually create complex dynamic content, Content Builder creates them from the data in an import file. Columns are used to designate the names of the enhanced dynamic content assets and each row contains the content or variations for each asset.
Content Builder saves the assets as Enhanced Dynamic Content Maps in the content library, which can then be used for emails and templates.
File upload |
Upload a file and select comma, semicolon, or tab as your delimiter. Choose whether to respect double quotes as a text qualifier. |
Data preparation |
Select a primary key field to map the content. Optionally edit the names for each enhanced dynamic asset. |
Content type |
Text, image, or exclude this column. |
Audience |
Determine if you want to link the content import to a Profile field or Data Extension. |
A/B testing has given email marketers the ability to continually find new and exciting ways to innovate and
measure success, with the goal of optimizing their email marketing strategy.
Testing comes down to three basic principles:
What am I testing? |
Sender Name, Subject Line, Content |
How am I testing? |
50/50 split, 10/10/80 split, 25/25/50 split |
Why am I testing? |
Increase overall open rate, click rate, or engagement rate |
There are numerous ways to organize an email testing strategy and figuring out the correct combination of the
“what”, ”how”, or “why” is the first step. A/B testing is built directly into Email Studio, allowing you to quickly and easily put your test plans into action and track the success over time, all in one place.
Sometimes, even the best conceived email strategies just don’t work, despite the hours of effort and resources used to bring your strategy to life. Where things went wrong, or continue to go wrong, is sometimes not so easy to pinpoint. If your email metrics are not meeting expectations and you are not reaching your KPIs, it’s time to take a second look at how your email campaigns are performing. There can be a long checklist of factors to consider: is the audience right, are the Subject Lines strong enough, does the content and imagery fit the audience?
Continually testing all of these factors over time allows you to optimize your email campaigns to deliver the message you envisioned
A/B testing in Email Studio provides email marketers a streamlined solution to create, implement, and track six types of test criteria:
Track which creative elements of your email perform better. | |
Sender Name |
Gauge inbox placement by the impact of different sender names. NOTE: You can select an existing sender name or manually enter one. |
Subject Line | Understand how different styles of Subject Lines impact overall open rates. |
Preheaders | Determine if using a Preheader influences open rates and figure out what type works best. |
Content Area | Gain insight into how copy, images, style and design affect engagement. |
Send Time | Optimize your email calendar and automation to increase visibility and timelines of email campaigns. |
A/B tests are created like User Initiated Emails or Salesforce Sends, where you select an email or emails, choose your target, exclusion and suppression audience or Data Extension, and then schedule the email campaign.
To run the actual A/B test, you need to identify how you want to divide the audience and how to determine a winner. The audience will be segmented into “control”, “test”, and “remainder.” You determine the ratio of the send based on how large a test you want to conduct. Some tests call for a true 50/50 split, while others warrant more caution by using a 10/10/80 split. Determining how and when a winner is chosen is based on what you are measuring, and when you need to measure it by. Winners are declared based on the performance of opens or clicks. Once a winner is declared, the remainder of the test is carried out based on how you divided the audience and how long you set the test period to be. You can measure the duration in hours or days, depending on the timelines of the email campaign.
A/B testing can also be used in combination with dynamic content, a dynamic subject line, or AMPscript, allowing you to stretch the limits of what you can accomplish.
The data you gather from continually testing any or all of these factors will help form the foundation for a plan, giving you greater visibility into your content, audience, and marketing goals. Where to start depends on what you need to accomplish. If you need to bolster open rates, focus on sender names, subject lines, or preheaders. If you need more clicks or traffic, then try testing two different email creatives. For engagement, use different content areas to determine what combination of copy and imagery works best for a particular product, promotion, or service.
A solid testing strategy will involve understanding what aspects of your email marketing strategy are lacking (opens, clicks, conversions, sales), identifying what elements need to be addressed, and the capability to implement those changes once your goals are reached.
A/B testing of Salesforce Data Extensions is enabled through the Marketing Cloud Connect integration. Emails created in Content Builder can be combined withSalesforce Data Extensions (Reports or Objects) and tracked in Marketing Cloud and Salesforce, on the individual record level. Over time, new Leads, Opportunities, and Contacts receive the winning version of the A/B test email.
AMPscript Impression tracking lets you define regions within your email to measure the performance of that particular region compared to the overall performance. This region can contain HTML, images, static content, or dynamic content.
BeginImpressionRegion() | Denotes the beginning of a region to track by impression tracking. |
EndImpressionRegion() | Identifies the end of a region to be tracked by impression tracking. |
ContentArea() ContentAreaByName() | Inserts content contained in the specified stored content area. |
%%[IF Contact_Status == ‘Lead’ THEN]%%
%%=BeginImpressionRegion("Lead_Menu")=%%
<a href="https://www.mysite.com">HOME</a>
<a href="https://www.mysite.com/about">ABOUT</a>
<a href="https://www.mysite.com/contact">CONTACT</a>
<a href="https://www.mysite.com/join">JOIN</a>
%%=EndImpressionRegion()=%%
%%[ELSEIF Contact_Status == ‘Member’ THEN]%%
%%=BeginImpressionRegion("Member_Menu")=%%
<a href="https://www.mysite.com">HOME</a>
<a href="https://www.mysite.com/about">ABOUT</a>
<a href="https://www.mysite.com/contact">CONTACT</a>
%%=EndImpressionRegion()=%%
%%[ELSE]%%
%%[ENDIF]%%
NOTE: An IF/ELSE statement would produce the same results, if only 2 possible values exist.
The ELSEIF statement was used to illustrate why there is a distinction in the content.
AMPscript processes Impression region names as case sensitive and stores these names at their first occurrence. You can define an unlimited number of unique impression regions in an email and allow for nested impression regions. Tracking information is provided for each Impression region in each email campaign.
Getting the most out of Email Studio requires understanding the capabilities of all aspects of these tools and mastering how they can all work together. There are several different approaches you can take, based on what you are trying to accomplish, timing, and resources available. Content Builder can be a starting point if your email marketing campaigns are centered around design, creative, and content; especially if you have design resources to consistently generate these for you. Data-driven email marketing strategies, or situations where information can be easily aggregated, will benefit the most from leveraging a combination of demographics, behavior, engagement, and purchases for micro-segmentation. Technical resources and capabilities can alleviate some of the potential struggles with coding numerous iterations of AMPscript or integrating additional systems like Salesforce or other CRM solutions.
Cart Abandonment & Re-engagement email campaign strategies are, in essence, the same. First, they require an action: a Lead or Contact visits your website or a customer adds a product to their cart to start a purchase. Next, there is a form of inaction: email tracking data shows these Leads and Contacts haven’t visited your website in some time. E-commerce data can show a customer has not made a repeat purchase or left the purchase process with items still in their cart. The final step is, what to do about it? Combining all aspects and capabilities of Email Studio into one process, you will discover the true strength of what is possible.
Omni Lifestyles Use Case |
Omni Lifestyles is an organic health supplement company that sells a line of daily multivitamins for men and women in one, two- and three-month supply options. Omni Lifestyles uses a multi-channel approach to generate new leads and customers, including paid media, social advertising, and print, and sell their supplements exclusively on their website. Focused on increasing revenue and retention, Omni Lifestyles decides to offer a 10% discount to all of their newest customers who purchased a one-month supply of their OMNI X daily vitamin packet. |
Re-engagement Use Case:
Scenario: A new customer purchased a one-month supply of OMNI X 45 days ago and has not ordered that product again. In order to generate repeat customers, a special 10% discount email automation will be developed for all new customers who purchased a product that has a one-month supply.
Objective: Create an automated triggered email, containing a 10% discount code that can be applied at checkout. The discount code will only be valid for new customers for 5 days from the triggered send.
Approach: Create a single email automation that combines Data Extensions, a Data Filter and AMPscript to generate emails for all products that have a one-month supply. Data will be utilized from 3 data sources, Customers, Products, and Purchase Data Extensions.
Content: The personalized triggered email contains an image of the product, promotional copy to encourage the customer to reorder, a prominent discount offer and code, and a button that is linked to the cart page adding the product.
Data:
CUSTOMERS | |
---|---|
Customer_ID | 343XFRGT567 |
email@domain.com | |
First_Name | Jeff |
First_Purchase_Date | 4/1/2019 |
Last_Purchase_Date | 4/1/2019 |
Last_Purchase_Product_ID | OMNIXMEN30 |
Last_Purchase_Product_Name | OMNI X - Men’s 30 day |
Last_Purchase_Value | 39.99 |
PRODUCTS | |
---|---|
Product_ID | OMNIXMEN30 |
Product_Name | OMNI X - Men’s 30 day |
Product_Quantity | 30 |
Product_Price | 39.99 |
Product_Description | OMNI X delivers a time-release formula of vitamins, herbs and minerals that have been shown to be beneficial to men's overall wellness. Combining the power of antioxidant and immune support to cardiovascular health, OMNI X is a high-potency multivitamin multimineral formula designed specifically for a man’s nutritional needs. |
Product_Image | OMNIXMEN30.jpg |
Product_Page_ID | OMNIXMEN30 |
Cart_URL | http://shop.domain.com/buy/OMNIXMEN30&qty=1&src=emlprod10 |
Product_Discount | 10 |
PURCHASES | |
---|---|
Customer_ID (ORDERS <=> CUSTOMERS) |
343XFRGT567 |
Purchase_ID | ORD452248889 |
Purchase_Date | 4/1/2019 |
Product_ID (ORDERS <=> PRODUCTS) |
OMNIXMEN30 |
Product_Name (ORDERS <=> PRODUCTS) |
OMNI X - Men’s 30 day |
Product_Price (ORDERS <=> PRODUCTS) |
39.99 |
Segmentation: The Data Filter will target only new customers (First Purchase Date is Last Purchase Date) of products with a one-month supply (Product Quantity) that qualify for a 10% discount (Product Discount)
DATAFILTE | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data Source | Customers Data Extension | ||||||||||||||
Data Filter |
|
||||||||||||||
Results | Filtered Data Extension from Customers Data Extension |
AMPscript: To create a single email that can be used for all one-month supply products with a 10% discount, the AMPscript functions used are:
LOOKUP | Inserts the specified value(s) from a Data Extension, based on the criteria specified in the rule. |
---|---|
OUTPUT | Returns the results of AMPscript code executed within a code block, such as Concat() or V(), and includes the results inside the rendered content. |
CONCAT | Concatenates the strings specified in the arguments. |
REDIRECTTO | Target of a link stored in an attribute, Data Extension, or variable. In order to retain tracking information for clicked links, you must include the anchor tags () within the email itself and not the link retrieved via AMPscript. |
%%[
VAR @Product_ID, @Product_Name, @Product_Price, @Product_Description, @Productt_Image, @Product_Page_ID, @Cart_URL, @Product_Discount
//SET product from Filtered Data Extension
SET @Product_ID = Last_Purchase_Product_ID
SET @Product_Name = Last_Purchase_Product_Name
//LOOKUP product information in PRODUCTS Data Extension using the Product_ID variable
SET @Product_Description =
LOOKUP(‘PRODUCTS’,’Product_Description’,’Product_ID’@Product_ID)
SET @Product_Page_ID =
LOOKUP(‘PRODUCTS’,’Product_Page_ID’,’Product_ID’@Product_ID)
SET @Cart_URL =
LOOKUP(‘PRODUCTS’,’Cart_URL’,’Product_ID’@Product_ID)
SET @Product_Discount =
LOOKUP(‘PRODUCTS’,’Product_Discount’,’Product_ID’@Product_ID)
]%%
Stored values for variables to be returned after processing the above AMPscript block at email campaign runtime.
@Product_ID | OMNIXMEN30 |
---|---|
@Product_Name | OMNI X - Men’s 30 day |
@Product_Description | OMNI X delivers a time-release formula of vitamins, herbs and minerals that have been shown to be beneficial to men's overall wellness. Combining the power of antioxidant and immune support to cardiovascular health, OMNI X is a high-potency multivitamin multimineral formula designed specifically for a man’s nutritional needs. |
@Product_Page_ID | OMNIXMEN |
@Cart_URL | http://shop.domain.com/buy/OMNIXMEN30&qty=1&src=emlprod10 |
@Product_Discount | 10 |
Subject Line: Did you forget about %%=V(@Product_Name)=%%?
Hi %%First_Name%%,
Did you forget about %%=V(@Product_Name)=%%?
%%=(CONCAT(‘http://images.domain.com/products/hero/’,@Product_Image))=%%
%%=V(@Product_Description)=%%
Use Promo Code %%=CONCAT(‘SAVE’,@Product_Discount,@Product_ID)=%%
trigger the recovery email and use the standard Marketing Cloud FTP. The Data Relationship will join data from the Customers Data Extension to the Abandoned Carts Data Extension, by linking the Customer_ID field in both Data Extensions. The Customer_ID is set as the Primary Key in the Customers Data Extension, which allows the resulting Data Extension from the Data Filter to be used for sending the email. The Data Filter will select only abandoned carts created today, with the same product and purchase information in the previous example. The AMPscript will generate a cart recovery URL and reminder of how many days remain to use their discount code.
VIEW ONLINE | %%=REDIRECTTO(CONCAT(‘http://www.domain.com?prod=’,@Product_ID))=%% |
---|---|
BUY NOW | %%=REDIRECTTO(@Cart_URL)=%% |
Solution | A single automation is implemented to send a re-engagement email to all new customers for all products that have a one-month supply with a discount code of 10%. |
Cart Abandonment Use Case:
Scenario: A customer received a re-engagement email with a 10% discount to reorder OMNI X from their initial purchase. The customer clicks the “Buy Now” button in the re-engagement email and begins the purchase process but doesn’t complete the order. A triggered email is generated to the customer alerting them that they have not completed their purchase and still have an item (or items) in their cart. The email contains a link to the current cart where they can resume the purchase process.
In this scenario, we will use a sample Abandoned Carts report as the e-commerce data source. Most e-commerce platforms provide built-in abandoned cart recovery capabilities or extensions, but Email Studio enables you to coordinate all of your outbound email campaigns to create a uniform and consistent user experience.
NOTE: This scenario will outline prerequisite processes that would occur in additional areas of Marketing Cloud or in other integrated systems, either by API or data warehouse imports.
Objective: Create an automated process that imports data from an e-commerce platform (API or import) and generates a triggered email campaign from Marketing Cloud 1 hour after the cart was created and abandoned.
The email will contain the active cart URL and the original discount code the customer received, plus a notification about the number of days they have left to use it with their purchase.
Approach: PREREQUISITE: Integration with an e-commerce platform (API or import) is required. Integrations that involve data imports can run hourly in Automation Studio to update Data Extensions in Email Studio.
Create a single automation that combines Data Extensions, Data Relationships, Data Filters, AMPscript and Import activities to transfer and upload the Abandoned Cart Report from the e-commerce platform and generate an email to customers who abandoned their purchase.
The Import activity will be “Add Only”, since we only want new abandoned carts to trigger the recovery email and use the standard Marketing Cloud FTP. The Data Relationship will join data from the Customers Data Extension to the Abandoned Carts Data Extension, by linking the Customer_ID field in both Data Extensions. The Customer_ID is set as the Primary Key in the Customers Data Extension, which allows the resulting Data Extension from the Data Filter to be used for sending the email. The Data Filter will select only abandoned carts created today, with the same product and purchase information in the previous example. The AMPscript will generate a cart recovery URL and reminder of how many days remain to use their discount code.
NOTE: To illustrate the capabilities available for “marketing” users of Email Studio, this scenario utilizes AMPscript and logic to account for an automated, non-realtime solution. Additional approaches can include using Triggered Sends, Queries, Journey Builder
Content: The personalized triggered email contains an image of the product, a prominent discount offer and code with time remaining, and a button linking the cart recovery URL.
Data:
CUSTOMERS | |
---|---|
Customer_ID | 343XFRGT567 |
email@domain.com | |
First_Name | Jeff |
First_Purchase_Date | 4/15/2019 |
Last_Purchase_Date | 4/15/2019 |
Last_Purchase_Product_ID | OMNIXMEN30 |
Last_Purchase_Product_Name | OMNI X - Men’s 30 day |
Last_Purchase_Value | 39.99 |
PRODUCTS | |
---|---|
Product_ID | OMNIXMEN30 |
Product_Name | OMNI X - Men’s 30 day |
Product_Quantity | 30 |
Product_Price | 39.99 |
Product_Description | OMNI X delivers a time-release formula of vitamins, herbs and minerals that have been shown to be beneficial to men's overall wellness. Combining the power of antioxidant and immune support to cardiovascular health, OMNI X is a high-potency multivitamin multimineral formula designed specifically for a man’s nutritional needs. |
Product_Image | OMNIXMEN30.jpg |
Product_Page_ID | OMNIXMEN30 |
Cart_URL | http://shop.domain.com/buy/OMNIXMEN30&qty=1&src=emlprod10 |
Product_Discount | 10 |
ABANDONED CARTS | |
---|---|
Cart_ID | 343XFRGT5673475fesdwasd |
Cart_Created_Date | 5/1/2019 12:30 PM |
Cart_Updated_Date | 5/1/2019 12:30 PM |
Customer_ID | 343XFRGT567 |
email@domain.com | |
Number_of_Items | 1 |
Quantity_of_Items | 1 |
Subtotal | 39.99 |
Discount_Code | SAVE10OMNIX30 |
IP_Address | 11.1.1.111 |
Cart_Recovery_URL | http://shop.domain.com/buy/session=343XFRGT5673475fesdwasd&prod= OMNIXMEN30&qty=1&src=emlprod10 |
DATA RELATIONSHIP | |
---|---|
Customer Data Extension | Customer_ID* |
Abondoned Cart Data Extension | Customer_ID |
Segmentation: The Data Filter will target newly created carts (Cart_Created_Date is Cart_Updated_Date) containing products with a one-month supply (Product Quantity) that qualify for a 10% discount (Product Discount)
DATAFILTER | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data Source | Customers Data Extension [with Abandoned Carts fields in Data Relationship] | ||||||||||||||
Data Filter |
|
||||||||||||||
Results | Filtered Data Extension from Customers Data Extension with additional Abandoned Cart data Extension fields. |
AMPscript: To create a single Abandoned Cart recovery email that can be used for all one-month supply products with a 10% discount, including the number of days they have left to use it, the AMPscript functions used are:
LOOKUP | Inserts the specified value(s) from a Data Extension, based on the criteria specified in the rule. | |||||||||||
OUTPUT | Returns the results of AMPscript code executed within a code block, such as Concat() or V(), and includes the results inside the rendered content. | |||||||||||
CONCAT | Concatenates the strings specified in the arguments. | |||||||||||
REDIRECTTO | Target of a link stored in an attribute, Data Extension, or variable. In order to retain tracking information for clicked links, you must include the anchor tags () within the email itself and not the link retrieved via AMPscript. | |||||||||||
DATEDIFF | Returns the difference between two dates. | |||||||||||
INSERTDE |
|
%%[
VAR @Cart_ID, @Cart_Created_Date, @Customer_ID, @Email, @Discount_Code, @Cart_Recovery_URL, @First_Name, @First_
Purchase_Date, @Discount_Expires
//SET abandoned cart data extension variables
@Cart_ID = Cart_ID
@Cart_Created_Date = Cart_Created_Date
@Customer_ID = Customer_ID
@Email = Email
@Discount_Code = Discount_Code
@Cart_Recovery_URL = Cart_Recovery_URL
//LOOKUP customer information in CUSTOMERS Data Extension using the Customer_ID variable
@First_Name = LOOKUP(‘CUSTOMERS’,’First_Name’,’Customer_ID’@Customer_ID)
@First_Purchase_Date = LOOKUP(‘CUSTOMERS’,’First_Purchase_Date’,’Customer_ID’@Customer_ID)
]%%
//SET discount expiry value
SET @Discount_Expires = DATEDIFF(@First_Purchase_Date,@Cart_Created_Date,’D’)
Stored values for variables to be returned after processing the above AMPscript block at email campaign runtime.
@Cart_ID | 343XFRGT5673475fesdwasd |
---|---|
@Cart_Created_Date | 5/1/2019 12:30 PM |
@Customer_ID | 343XFRGT567 |
email@domain.com | |
@Discount_Code | SAVE10OMNIX30 |
@Cart_Recovery_URL | http://shop.domain.com/buy/session=343XFRGT5673475fesdwasd&prod=OMNIXMEN30& qty=1&src=emlprod10 |
@First_Name | Jeff |
@First_Purchase_Date | 4/15/2019 |
@Discount_Expires | 3 |
Subject Line: Did you forget about something?
Hi %%=V(@First_Name)=%%,
We noticed you stopped by, but there are still items in your cart.
%%[IF @Discount_Expires <= 5 THEN]%%
Hurry, you only have %%=V(@Discount_Expires)=%% to use your discount code %%=V(@Discount_Code)=%%
CONTINUE PURCHASE
%%=REDIRECTTO(@Cart_Recovery_URL)=%%
%%[ELSE]%%
CONTINUE PURCHASE
%%=REDIRECTTO(@Cart_Recovery_URL)=%%
We’re sorry… your discount code has expired.
%%[ENDIF]%%
<!-- AMPscript to add records to Data Extension using the InsertDE function -->
%%=INSERTDE('ABANDONED_CART_EMAIL_LOG','Customer_ID’,Customer_ID,’Email’,Email,’Cart_ID’,Cart_ID,’Recovery_Email_Date’,NOW())=%%
Solution: An abandoned cart automation is implemented to send a cart recovery email to all customers who started a new purchase after receiving the re-engagement email which contained a 10% discount code, allowing them to continue their purchase and alerting them to the number of days they have left to get their discount, if it hasn’t already expired.
AMPscript enables email marketers to evolve their overall strategy by providing the capability to define content-based marketing options, which utilize a combination of demographic, behavioral, engagement, product, and purchase data available in Email Studio. There are any number of use cases and scenarios that can be developed, combining multiple aspects of variables, conditions, statements, and functions.
USE CASE - OMNI LIFESTYLE |
Omni Lifestyle is an organic health supplement company that sells a line of daily multivitamins for men and women in one, two- and three-month supply options. Omni Lifestyle uses a multi-channel approach to generate new leads and customers, including paid media, social advertising, and print, and sell their supplements exclusively on their website. Focused on increasing revenue and retention, Omni Lifestyle decides to offer a 10% discount to all of their newest customers who purchased a one-month supply of their OMNI X daily vitamin packet. |
USE CASE - OMNI LIFESTYLE - CUSTOMER DATA EXTENSION |
|
Customer_ID |
343XFRGT567 |
|
email@domain.com |
First_Name |
Jeff |
Gender |
Male |
Member_Account |
TRUE |
Rewards_Member |
FALSE |
First_Purchase_Date |
4/15/2019 |
Last_Purchase_Date |
4/15/2019 |
Last_Purchase_Value |
39.99 |
Last_Purchase_Product_ID |
OMNIXMEN30 |
Last_Purchase_Product_Name |
OMNI X - Men’s 30 day |
Last_Purchase_Product_Category |
Multivitamin |
Last_Purchase_Product_Quantity |
30 |
Last_Purchase_Product_Price |
39.99 |
Last_Purchase_Product_Description |
OMNI X delivers a time-release formula of vitamins, herbs and minerals that have been shown to be beneficial to men's overall wellness. Combining the power of antioxidant and immune support to cardiovascular health, OMNI X is a high-potency multivitamin multimineral formula designed specifically for a man’s nutritional needs. |
Auto_Renew |
FALSE |
USE CASE - OMNI LIFESTYLE - PRODUCT DATA EXTENSION
USE CASE - OMNI LIFESTYLE - AMPSCRIPT - IF/ELSE STATEMENTS:
Scenario: Omni Lifestyle is launching a new Auto Renew feature for their one-month supply of OMNI X products. The Auto Renew feature allows customers to enroll in the program which offers free shipping and a 10% product discount. Customers can get an additional 5% off their next purchase if they also decide to become a Rewards Member. The Auto Renew option will be added to the existing Re-engagement campaign promotional offers.
The existing Re-engagement campaign will not include any customers who signed up for the Auto Renew option prior to the Re-engagement email since their Last Purchase Date will not equal their First Purchase Date. Additional criteria can also be added to the Re-engagement Data Filter to segment customers based on other actions or behaviors.
AMPscript: %%[
VAR @Customer_ID, @Email, @First_Name, @Gender, @Member_Account, @Rewards_Member, @Last_Purchase_Product_ID, @Auto_Renew, @Product_ID, @Product_Name, @Product_Line, @Product_Class, @Product_Description, @Product_Image, @Product_Quantity, @Product_Price, @Cart_URL, @Product_Gender, @Supplement_Class
//SET Customer variables
SET @Customer_ID = Customer_ID
SET @Email = Email
SET @First_Name = First_Name
SET @Gender = Gender
SET @Member_Account = Member_Account
SET @Rewards_Member = Rewards_Member
SET @Auto_Renew = Auto_Renew
//SET Product variables based on Customer variables
SET @Product_ID = Last_Purchase_Product_ID
SET @Product_Name = LOOKUP('PRODUCTS','Product_Name','Product_ID',@Product_ID)
SET @Product_Line = LOOKUP('PRODUCTS','Product_Line','Product_ID',@Product_ID)
SET @Product_Class = LOOKUP('PRODUCTS','Product_Class','Product_ID',@Product_ID)
SET @Product_Description = LOOKUP('PRODUCTS','Product_Description','Product_ID',@Product_ID)
SET @Product_Image = LOOKUP('PRODUCTS','Product_Image','Product_ID',@Product_ID)
SET @Product_Quantity = LOOKUP('PRODUCTS','Product_Quantity','Product_ID',@Product_ID)
SET @Product_Price = LOOKUP('PRODUCTS','Product_Price','Product_ID',@Product_ID)
SET @Cart_URL = LOOKUP('PRODUCTS','Cart_URL','Product_ID',@Product_ID)
SET @Product_Gender = LOOKUP('PRODUCTS','Gender','Product_ID',@Product_ID)
SET @Supplement_Class = LOOKUP('PRODUCTS','Supplement_Class','Product_ID',@Product_ID)
]%%
Stored values for variables to be returned after processing the above AMPscript block at email campaign runtime.
Subject Line: Did you forget about %%=V(@Product_Name)=%%?
Hi %%First_Name%%,
Did you forget about %%=V(@Product_Name)=%%?
%%=(CONCAT(‘http://images.domain.com/products/hero/’,@Product_Image))=%%
%%=V(@Product_Description)=%%
%%[IF @Product_Line == ‘OMNI X’ AND @Auto_Renew == ‘FALSE’ AND @Rewards_Member == ‘FALSE’ THEN]%%
Use Promo Code %%=CONCAT(‘SAVE’,@Product_Discount,@Product_ID)=%% and SAVE 10% TODAY!
Select our new Auto Renew option at checkout and get OMNI X delivered straight to your door, with an ADDITIONAL 10% OFF + FREE SHIPPING!!!
Not a Rewards Member yet? ACT NOW and save even more! Receive exclusive offers, news and insights from the Omni Lifestyle team of nutritional experts. Sign up is free, so join today and save 5% on your next purchase.
%%[ELSEIF @Product_Line == ‘OMNI X’ AND @Auto_Renew == ‘FALSE’ AND @Rewards_Member == ‘TRUE’ THEN]%%
Use Promo Code %%=CONCAT(‘SAVE’,@Product_Discount,@Product_ID)=%% and SAVE 10% TODAY!
Select our new Auto Renew option at checkout and get OMNI X delivered straight to your door, with an ADDITIONAL 10% OFF + FREE SHIPPING!!!
%%[ELSE]%%
%%[ENDIF]%%
VIEW ONLINE
%%=REDIRECTTO(CONCAT(‘http://www.domain.com?prod=’,@Product_ID))=%%
BUY NOW
%%=REDIRECTTO(@Cart_URL)=%%
Solution: The re-engagement automation is updated to send a re-engagement email to all new customers for all products that have a one-month supply with a discount code of 10%, with additional offers including the new Auto Renew option and for becoming a Rewards Member.
USE CASE - OMNI LIFESTYLE - AMPSCRIPT - CUSTOMERS ALSO PURCHASED
Scenario: Omni Lifestyle wants to incorporate a “Customers Also Purchased” feature currently on their website into their Abandoned Cart triggered email to upsell additional products to interested customers who haven’t completed their order, with only a single product in their cart.
The “Customers Also Purchased” section will include a maximum of three additional products from the “Supplement Class” corresponding to the “Product Class.” Each product shown will include the product name, product image, product price, and an “Add to Cart” button that will append the product to the “Abandoned Cart URL” so the customer can complete the purchase.
PREREQUISITE: Integration with an e-commerce platform (API or import) is required. Integrations that involve data imports can run hourly in Automation Studio to update Data Extensions in Email Studio.
AMPscript: %%[
VAR @Cart_ID, @Cart_Created_Date, @Customer_ID, @Email, @Cart_Product_ID, @Number_of_Items, @Cart_Recovery_URL, @First_Name, @Gender, @Product_ID, @Product_Name, @Product_Line, @Product_Class, @Product_Image, @Product_Quantity, @Product_Price, @Product_Gender, @Supplement_Class
//SET Abandoned Cart data extension variables
@Cart_ID = Cart_ID
@Cart_Created_Date = Cart_Created_Date
@Customer_ID = Customer_ID
@Cart_Product_ID = Cart_Product_ID
@Email = Email
@Number_of_Items
@Cart_Recovery_URL = Cart_Recovery_URL
//SET Customer data extension variables
@First_Name = LOOKUP(‘CUSTOMERS’,’First_Name’,’Customer_ID’@Customer_ID)
@Gender = LOOKUP(‘CUSTOMERS’,’Gender’,’Customer_ID’@Customer_ID)
Stored values for variables to be returned after processing the above AMPscript block at email campaign runtime.
Subject Line: Did you forget about something?
Hi %%=V(@First_Name)=%%,
We noticed you stopped by, but there are still items in your cart.
%%[IF @Discount_Expires <= 5 THEN]%%
Hurry, you only have %%=V(@Discount_Expires)=%% to use your discount code %%=V(@Discount_Code)=%%
CONTINUE PURCHASE
%%=REDIRECTTO(@Cart_Recovery_URL)=%%
%%[ELSE]%%
CONTINUE PURCHASE
%%=REDIRECTTO(@Cart_Recovery_URL)=%%
We’re sorry… your discount code has expired.
%%[ENDIF]%%
%%[IF @Number_of_Items == ‘1’ THEN]%%
%%[
VAR @Product_ID, @Product_Name, @Product_Line, @Product_Class, @Product_Image, @Product_Quantity, @Product_Price, @Product_Gender, @Supplement_Class
SET @Product_ID = Cart_Product_ID
SET @Supplement_Class = LOOKUP('PRODUCTS','Supplement_Class','Product_ID',@Product_ID)
SET @rows = LOOKUPROWS(‘PRODUCTS’,’Product_Class’,@Supplement_Class)
IF ROWCOUNT(@rows) >= 1 THEN]%%
While you’re here, check out other popular products customers also purchased
%%[
FOR @i = 1 DOWNTO 3 DO
SET @row = ROW(@rows,@i)
SET @Product_Name = FIELD(@row,’Product_Name’)
SET @Product_Line = FIELD(@row,’Product_Line’)
SET @Product_Class = FIELD(@row,’Product_Class’)
SET @Product_Image = FIELD(@row,’Product_Image’)
SET @Product_Price = FIELD(@row,’Product_Price’)
]%%
%%=V(@Product_Name)=%%
%%=(CONCAT(‘http://images.domain.com/products/hero/’,@Product_Image))=%%
%%=CONCAT(‘SAVE’,@Product_Discount,@Product_ID)=%
ADD & CONTINUE PURCHASE
%%=REDIRECTTO(CONCAT(@Cart_Recovery_URL,&addtocart=,@Product_ID))=%%
%%[NEXT @i]%%
]%%
- END CUSTOMERS ALSO PURCHASED -->
%%[ELSE]%%
%%[ENDIF]%%
- AMPscript to add records to Data Extension using the InsertDE function -->
%%=INSERTDE('ABANDONED_CART_EMAIL_LOG','Customer_ID’,Customer_ID,’Email’,Email,’Cart_ID’,Cart_ID,’Recovery_Email_Date’,NOW())=%%
Solution: The Abandoned Cart automation is updated to include additional related product offers based on the corresponding “Supplement Class” of a product in the recovery email to all customers. The additional products are added directly into the abandoned cart so the customer can complete their purchase with the additional items added.
Email remains at the forefront of effective marketing strategies and continues to be the focus of individuals and companies looking to increase acquisition, generate sales, and deliver ROI. Even though social and mobile have grown rapidly in adoption and visibility, email has continued to outperform them when it comes to total users, engagement, and conversion. Email Studio is the first, and often the most crucial step in developing a long-term cross-channel marketing roadmap.
Email Studio can take you from creating your very first marketing campaign to building the most sophisticated email journey you can think of, all in the same place. Do consider subscribing to a Salesforce marketing cloud newsletter to help you learn the ropes as a beginner. Doing so will help you gain a detailed understanding of Salesforce marketing cloud documentation also. If you are an avid email marketer, just starting out, or looking for enterprise-level scalability, Email Studio is the solution for designing stellar looking email campaigns, engaging the right audience with the right messaging, delivering interactive content, and strengthening your relationship with your audience through automation and journeys.
Mike Welthy has been involved in all things email marketing for the past 15 years – creative design, technical evaluation, systems integration, marketing operations, and campaign strategy. Mike works with companies to help them build an integrated email program that utilizes a combination of analytics, behavioral data, and audience interactions to create a personalized one-to-one relationship with each subscriber and customer.
Mike has worked with a variety of companies across many industries, including Rolling Stone, US Weekly, The Economist, WebMD, Equinox, RenewLife, and Mars. He has previously held positions as Director of Digital Marketing for Strike Holdings and Director of Marketing Operations at Ziff Davis Enterprise.