#1- The Ampscript Syntax

Ampscript is one of the language of Salesforce Marketing Cloud. Ampscript runs on the servers of Salesforce Marketing Cloud. The code is embedded in the HTML emails, email text messages, landing pages, mobile phone messages, mobile app push notifications.

The code is rendered from top to bottom. What I mean is, it is an interpreted language. We do not need any special compiler to run it.

I mostly use it for email or any Salesforce Marketing Cloud message personalization. To create a personalized message, the Ampscript code needs to be interacting with the data model in the marketing cloud. The data mostly recorded in the Data Extensions of Marketing Cloud. In some case, the data may be in lists, or comes with json payloads thru an API interaction. In my following articles, I will give more information on how to interact with data.

When using Ampscript as Ampscript Block, the code is written between double percentage and squared brackets( %%[ ]%% )

This is an simple syntax of an Ampscript Block:


 var @firstName 
 var @lastName 
 set @firstName = "Mustafa"
 set @lastName = "Unlukara"


The Ampscript code, when used in HTML (inline) is written in double percentage chars (%%).

Here is an simple example:

Dear %%=v(@firstName)=%%  %%=v(@lastName)=%%,<br />Thank you for choosing our company as your service provider.

You can also write your Ampscript code within and SSJS (Server Side Javascript) code.

Here is the syntax for it:

<script runat="server" language="ampscript"> 

/* Write your Ampscript code here.  */ 


Top Data Management Platforms

Data Management Platforms, aka DMPs, are main platforms for keeping digital data related to digital marketing. Such as, Cookie IDs, browser information and mobile identifiers. They help to market to different customer segments, demographic customers, past browser interactions, customer locations, multiple device usages and many more…

Why to use DMPs?

  • First of all, all of your data comes to an unique, single platform. You get a view of your customers over multiple browsers, devices, locations and etc…
  • DMP can find you new and identical customers. All big DMPs provide a lookalike statistical modeling to find similar audience(or customer) to your current audience(or customer).
  • DMPs provide regular and real-time results. You obtain a long term, regular and continuous look over your customer or lookalike customers via DMP.

These are the top benefits I found to use DMPs.

What are the top DMP Platforms.

Nowadays, these platforms are the most used DMP Platforms.

  • Salesforce DMP (Previously known as Krux)
  • OnAudience.com
  • Snowflake
  • Lotame
  • CloudEra
  • Nielsen

Salesforce DMP

Formerly known as Krux. Salesforce obtained Krux late 2016 and it is now Salesforce DMP. This is a DMP tool that digital marketers capture and unify data from multiple touches. It is backed with Salesforce Einstein artificial intelligence. It has enormous machine learning capabilities that helps marketers to track customers(or lookalike customers) from multiple channels.

Website : https://www.salesforce.com/products/marketing-cloud/data-management/


OnAudience.com provides a very easy use interface. They provide fast and easy audience segmentation based on popular attributes such as gender, age, interests and etc… This software is getting more attention from digital marketers each year.

Website: OnAudience.com


Snowflake has a one feature that benefits to digital marketers. It is data management service. It provides a fast and easy data management service opportunity for your data management requirements. This service eliminates need to integrate your data to your DMP or creating data manipulation ahead of using a DMP service. Snowflake has an easy integration tools to gather data from your multiple cloud-based software.

Website: SnowFlake.com


You can connect and feed Lotame with multiple data sources such as email, social data, mobile data, CRM data and etc… In addition to DMP features, Lotame provides tools to enhance your website optimization for your marketing purposes. Lotame also provides an effective first party data onboarding service.

Website: Lotame.com


CloudEra is one of the few platforms for any kind of data. CloudEra provides tools for Data Engineering also. It provides a data hub service for your multiple data sources. Also you can keep some of your operational data in CloudEra and share that information with CloudEra provided DMP service, which makes a faster return on results when you need faster results (for instance finding a lookalike customers for your ecommerce site during a short holiday/campaign season).

Website: CloudEra.com


Nielsen allows you to select from their extensive audience segmentation. They provide personalized advertising and content across multiple channels. Your company users may be able to make analysis on customer journeys.

Website: Nielsen.com

What is Marketing Automation?

To write a basic definition, marketing automation is the use of software applications and computer hardware to create processes to replace marketing operations (and tasks) for our marketing purposes.

Software applications in today’s marketing world, has a lion’s share in marketing automation. Expectation from a simple marketing automation software is able to create an email newsletter, with some automatically created content if possible.

Personalization of the message to the customer has lion’s share on the marketing purposes. Personalization, still has a big importance, because managing marketing budget for sending the right message to the right audience at the right time is very important. In today’s world still some parts of the marketing budget goes to the audiences that do not want the message we sent (or simply some of the marketing budget goes to the people who do not want to get messages from us) .

Data manipulation (or data operations) has the lion’s share among the processes. A message created in marketing automation, requires many data points from multiple software systems. A personal message, requires at least the name of the person which may come from our CRM system. We may want to take attention of that person with a better discount on specific products, based on that persons previous purchase history, which may come from our Accounting or Orders software system. Only this single aim requires us to make integration between our Marketing Automation, CRM and Accounting systems. Then, we need to make adequate data manipulation to select the right persons for the right message.

Other reasons, that make Marketing Automation important are; gather traffic to your product or service (or website), convert that traffic to prospective leads, generate sales from those leads and increase your revenue on the previous customers. The best marketing automation tools all of these processes are executed automatically.

A simple business case on how marketing automation works is: A person browses sneakers on your web store. He/she sees a pop-up which says get a 10% discount offer on all sneakers when he/she fills-out a simple form. When the person fills the form, the marketing automation software sends a personalized message (according to the filled form data) in your corporate email template.

Another simple business case is for abandoned shopping cart emails. Sending an email, designed to get attention of people who abandoned their shopping cart in your website. Those people may get a reminder or a small amount of discount to have encourage! to finish their purchase.

There are many examples of how you can use marketing automation. Here are some;

  • Automatically sharing your message at different social media accounts.
  • Dynamic pricing to your products according to behaviors of people.
  • Use all interactions of people with your company for creating right marketing messages.
  • Create set of rules and journeys for your visitors, customers and prospective customers.
  • Integrate all software in your company such as Accounting, CRM, Service, ERP for your marketing purposes.
  • Manage all your leads, sales, marketing and other tools from a single dashboard.

Adobe Campaign, Salesforce Marketing Cloud, Oracle Eloqua and Marketo (now Adobe Marketo) are the best providers of Marketing Automation Software.

Companies save lots of time converting their repetitive marketing tasks to automated processes.

People (customers) tend to respond more and faster, when they get personalized marketing messages. This improves ROI.

Quality of the leads jump over the expectations. The higher of the quality of the leads, the more sales.

Abilities and corporation of sales, service, production and marketing people in the company increases.

The last one in my mind is the awareness to your company. Marketing automation has a huge positive impact on the awareness to your products or services.

What is the difference? Contact Key vs Contact ID vs Subscriber Key ?

What is the difference between Contact Key, Subscriber Key and Contact ID in Salesforce Marketing Cloud

If you are user of Salesforce Marketing Cloud, or managing a project that deals with Salesforce Marketing Cloud, you may hear these terms from the tech and developer teams.

  • Contact Key
  • Contact ID
  • Subscriber Key

All of these sounds familiar, and seems to point the same thing, right? I bet you know the answer, these are all related to Contact Data in Salesforce Marketing Cloud.

Let’s look one by one.

Contact Key

This is a unique identifier of the contact, that is related to different channels. So, a single contact key works between the contact itself, the channels and the relationship. The Contact Key is the same for the contact among multiple (different) channels.

Imagine that one of your contact is in your email channel. There is a specific identifier for the contact in email channel, for instance email address (I know what technical architectures think, just assume the simplest case). Then, this contact is also in one of our text message list. This channel uses the mobile phone number as a specific identifier.

As a marketing manager, you want to be consistent among these two channels. You do not want the same person to get an email and text message for the same message.

The Contact Key gives you this ability and consistence. Existence of the contact key gives you the consistence of sending messages thru multiple channels and identify your contacts. Email and Text Message channels in our case.

Contact ID

Contact ID is a unique number for your contacts in Salesforce Marketing Cloud. This number helps uniquely identifying the contact on the back-end system. This is an application level number thru the entire Marketing Cloud system.

Subscriber Key

This is the most known key among marketers. Subscriber Key identifies the contacts in the Email Studio. Since email is the most used communication channel, Email Studio is the most used app in Salesforce Marketing Cloud. I have never seen anyone who does not heard about the Subscriber Key.

What are the benefits of Subscriber Key ?

  • Maintains uniqueness of a single separate contact among all subscriber attributes. (For instance, if two of your contacts use exactly the same email address, you can maintain two different set of subscriber attributes to these persons.) It sounds confusing, let me give a specific real life example. Lets think a wife and a husband shops for different products from your store. Wife purchases and has an interest on kitchen appliances. The husband purchases and has an interest on tech products. They share the same email address. You know, they use the same email, but they want to get marketing emails according to their interests. Yes, you bet, Subscriber Key helps you to identify these two persons.
  • Sometimes, a single person may need to get a single communication message for multiple emails he/she owns. You may have both business email address and personal email address of a person. If you want to send marketing messages only on his/her personal email. Then, you need to identify this person on Subscriber Key.

Subscriber Key decision depends on the business purposes. The Subscriber Key must be consistent among all your entire marketing operations.

And keep in your mind, good Marketing Cloud experts never use the email address as Subscriber Key.

Hope this article helped you understanding the differences between Customer Key, Contact ID and Subscriber Key. If you liked my article, please share it with your Social Media, please feel free to write your comments below.

Dynamical Personalization with Ampscript

Ampscript is a very easy way to personalize emails dynamically in Salesforce Marketing Cloud.

When you have a “Sendable Data Extension”, we are able to populate the data in the fields by adding fieldname between double percentage (%%) signs.

Here is an example;

Let’s say our Sendable DataExtension contains the following records.

CustomerIDFirstName LastNameEmailAddress

We want to start emails with the following format,

Dear FirstName,

In our data extension, we do not have Proper case for values. Some first name values are missing.

We need to send First names in a proper case, and for the missing values we need to use “Valued Customer” text, instead of sending emails with missing first name.

Here is the Ampscript solution code of the personalization ampscript.

Ampscript Personalization Code

“Valued Customer” is added by IIF statement when the first name value of the customer record is missing.

Salesforce picked Azure to power Marketing Cloud Infrastructure

Salesforce made a new partnership with Microsoft recently.

Microsoft Azure platform is going to host the Salesforce Marketing Cloud.

The Salesforce and Microsoft new alliance is not only limited to the Marketing Cloud. Now, Salesforce is going to build an integration between its Sales and Service Clouds to Microsoft Teams also. So, the new integration will make life easier for mutual users of both brands on these platforms. The Microsoft Teams users will be able to search their contacts directly in their Teams app in the early months of 2021. Previously, Salesforce created integrations to some other Microsoft platforms like OneNote and Skype for Business.

In one statement Salesforce co-CEOs Marc Benioff and Keith Block said, “We are excited to expand our partnership with Microsoft and bring together Salesforce with Azure and Teams to deliver incredible customer experiences.”

Salesforce currently uses both Amazon Web Services and Google Cloud Platform. The new Microsoft agreement makes Salesforce a big customer for all of the three Cloud Providers. Salesforce mentioned that this new agreement has no impact on its relations with the other two platforms.

This is a huge and meaningful win for Microsoft, just after Microsoft Azure is chosen by the Pentagon.

Introducing to New Salesforce Content Management System

Today, Salesforce announced its new CMS platform. The main motivation is to provide a tool to distribute your content to any channel or device by using this CMS.

As you know, the current marketing world depends on omnichannel. As users of these marketing tools, we expect consistent customer experience. We expect the same consistency from the email we read, from the store we visit, from the video we watch, from the support team we contact, from the salesperson we met, or even from the message of the CxO of the brand we read on the newspaper.

Salesforce thinks that there is a gap with the current CMS systems that brands use. When brands are interacting with us, Salesforce believes that CMS systems should be more improved when increasing the customer experience when customers are in a customer journey in some way. For instance, if one of the salesperson(or a marketing email, you name it) of the brand offers a unique 10% discount to a user, that user expects that price or promotion while browsing the website of the brand. This is the gap Salesforce focuses to fill with the new CMS.

On the other side, there is another problem with traditional CMS systems. When a marketing team creates a new campaign, it may take days (or even months in some cases) for the developer and designer team to add that campaign info to the website. Salesforce offers a connected system advantage between CRM, Marketing Cloud with CMS.

Simplicity is a keyword.

The new CMS offers brands to create, manage and deliver content easily. Any person in the Marketing team may be able to create a CMS content within the consistency of the CMS structure.

Touches the other Software

Yeap, all Salesforce software used in the company is going to connect with your CMS. The info in a personalized email from Salesforce Marketing Cloud, a unique offer in Salesforce CRM, a special service record in Salesforce Service Cloud will be connected with the CMS piece of the customer touch.

With Salesforce, now the CMS is going to be part of the Customer Experience magic!

Email Data Personalization Strings

Here you can find the list of current Salesforce Marketing Cloud Personalization Strings that are used for Email Data.

Personalization StringDescription
%%xtmonth%%Full name of the month in which the email is sent
%%xtmonthnumeric%%Current month as a number
%%xtday%%Current date of the month when the email was sent (for example, 22)
%%xtdayofweek%%Current day of the week when the email was sent (for example, Thursday)
%%xtyear%%The current year when the email was sent
%%xtshortdate%%Current date when the email was sent in a short format. For example, 12/13/2010
%%xtlongdate%%Current date when the email was sent in a long format. For example, Monday, December 13, 2010
%%linkname%%Descriptive name of a hyperlink, known as the link alias. This string populates with the value of the link’s alias or the complete URL if no alias is specified at the link level. This personalization string is only available in use with the web analytics connector. This string allows web analytic programs to identify web activity that initiated from an individual link within the email. Link alias values generated via personalization strings, AMPScript, or SSJS does not reflect in the %%linkname%% value.
%%emailname_%%The internal name of the email
%%_messagecontext%%The context in which the customer views the email. Resolves to these values:

SEND – Display the rendered final message for sending to the subscriber

PREVIEW – Display the send preview options available within the editor

VAWP – Display content

VIEWSENT – Display the non-subscriber link to preview content

FTAF – Display the rendered Forward To a Friend message

LANDINGPAGE – Display a landing page or microsite

VALIDATION – Display information corresponding to the validate option in Marketing Cloud

LINKRESOLUTION – Display resolved dynamic script at click time

SMS – Display SMS message content

SOCIAL – Display Social Forward content

SITE – Display CloudPage content
%%_MessageTypePreference%%Resolves to Text or HTML according to the subscriber’s email type preference
%%_replycontent%%The body of the email you sent. This personalization string is used in triggered sends to place the body of an email into a reply email
%%_IsTestSend%%Resolves to True if the email job is marked as a Test Send.
if _isTestSend == false then
… // this code does not run for test sends
%%jobid%%Email send ID (the unique identifier associated with this send of the email, for tracking data purposes)
%%_PreHeader%%Any content with the assigned value for the Preheader attribute of the email message
Assign the Preheader as a variable –
set @preheader = [_preheader]
and then use it in the Preheader field –
%%double_opt_in_url%%Inserts the double-opt-in link in an email.

Marketing Intelligence with Analytics

As the marketing world connects with more automation systems, the number of interaction points with the end customers increases tremendously each day. End customers that have multiple languages, multiple regions, multiple channels, multiple services get more and more messages through the Marketing Automation systems. A marketer has to deal with multi-vendor solutions that generate huge data each day. These numbers, keeps climbing up and up.

Most of the marketers, want to have a unified view of their data, want to adopt a kind of centralized data house for their end customers’ marketing data. Some very few lucky ones have this opportunity. Some of the CMO’s I personally met, already gave up to have a centralized data house for their marketing data. Some of the companies’ Marketing Automation systems – I used work – create multi-single digit gigabytes of data per system, and XX gigabytes of daily data to store from multiple systems. In addition to this, some of the software systems they use are not capable of backing this amount of data daily.

And now, we are where the Marketing Intelligence (MI) comes in. I know that most of you know Business Intelligence (BI). BI is a tool that makes life easier for short period tactics. It also helps pretty coolly for creating some future business decisions.

What about speed and processing huge volume of data? This is also where BI is not enough and MI comes on to the stage. Marketing Intelligence brings data insights, speed as well as real-time (automated) reporting and visualization.