Einstein: the setup in Salesforce Marketing Cloud

Your recommendation engine in Salesforce Marketing Cloud – part 1


If you are currently working with Salesforce Marketing Cloud, you might wonder what’s hidden behind the Einstein menu item (formerly known as Personalization Builder).


Salesforce Einstein recommentations





If you have a Pro edition, Email recommendations is included in your license. With Corporate or Enterprise, you also get Web recommendations.

So … what does it do?

This is what Salesforce has to say about it: “Einstein delivers the next best product, content, or offer to every individual through product and content recommendations for email and web. Every customer interaction is an insight. With every click, download, view, and purchase, customers are giving data about their preferences. Einstein combines user behaviour with algorithms and your unique business rules to build a user profile of affinities. Use that profile to determine the most relevant content and products for each customer in real time.”

And that’s all true. ‘Powered by Einstein’ is a bit of a stretch, because the core technology is based on iGoDigital, acquired by ExactTarget as long ago as 2012. Salesforce has kept working on it over the years and the improved algorithms provide powerful recommendations.

We will take a closer look at what Einstein can offer you and how to use it; the information that will help you to take that next step.
This first part describes several technical steps, so we recommend that marketers read through it so they understand the process and can collaborate with a Marketing Cloud developer for the more complicated implementations.

Where do I start?

We will start with the catalog, as it lies at the heart of Einstein. A catalog can be based on products (retail) or content (more blog related). It holds all your products or content data with as many details as possible (SKU, price, URL’s, stock, description, categories, keywords etc.). Affinity profiles are all based on user, customer or visitor behaviour and links between products or content.

Step 1

Decide if you want to use product or content (or both) and set up your catalog with field attributes, activity tracking (e.g. category view, shopping cart, purchases).

Personalization Builder

From there start the Collect Tracking Code Implementation.

Personalization Builder

Step 2

If you are in retail, you will probably have a product catalog with all your SKUs from your ecommerce platform. It might even already be in Salesforce Marketing Cloud.

Importing your catalog into Einstein is one of the more time consuming parts of the implementation. You have two import options:

1. Flat-File Upload. Marketing Cloud requires that the import file for the catalog is delivered as a pipe delimited value (PDV) flat-file format. The file upload is added to an FTP account or publicly accessible web URL and imported into Einstein twice a day.

2. Streaming Updates. The Streaming Update option adds and updates products and content through another snippet of JavaScript.

We usually advise our clients to go for option 1, as it saves additional website integration and API calls.

During the setup of the import you have the option to map your catalog fields with the default fields that Marketing Cloud is expecting, and you can select which fields to tag. The tagging is also a very important step because this determines the fields that are used to build your affinity per profile. For example, tag the fields for brand and category to build a affinity on these values (affinity brand is LG and affinity category is TV).

Step 3

Once the catalog is in place, it’s time to start collecting data. This is another tricky part and you might need help from your web developer to implement all the necessary Collect Codes for tracking behaviour on your website. These Collect Tracking Codes are JavaScript snippets that are used to capture data about known contacts and unknown visitor behaviour.

First, collect the JavaScript snippets that Marketing Cloud has made available within the implementation part of Web Recommendations (Admin). Start with the Base Collect Code that needs to be implemented on every page of your web site.

<script type=”text/javascript” src=”https://MID.collect.igodigital.com/collect.js”> </script>

<script type=”text/javascript”>
_etmc.push([“setOrgId”, “MID”]);

That’s the easy one. Next, we need to capture user information and attributes, this script is vital for identifying your unknown visitors.

<script type=”text/javascript”>

          _etmc.push([“setOrgId”, “MID”]);
_etmc.push([“setUserInfo”, {“email”: “INSERT_EMAIL_OR_UNIQUE_ID”}]);

You can use this script on login pages, sign up pages, login steps, check out processes and newsletter sign ups to capture your visitor’s identification. However, we recommend a different approach.

Why? Because signups and logins are always email address related and we usually avoid using email address as the identifier in Marketing Cloud or in visitor tracking. That identifier is normally linked to a customer or prospect during back end integration (Sales or Service Cloud for example). That’s why we recommend the method of identification via marketing emails.

How? Add your Contact ID (or other unique ID in Marketing Cloud) as the subscriberkey in your URL like this: https://[insert your URL]/t/sfmc?utm_campaign=wk18&utm_source=newsletter&utm_medium=email&key=%%subscriberkey%% (Salesforce support can automate this for you).

Finally, your web developer needs to grab the %%subscriberkey%% and place it in the JavaScript snippet replacing “INSERT_EMAIL_OR_UNIQUE_ID”. Now your unknown visitor has been identified and all historical behavior on the website is linked to this known profile.

After setting up the identification script you will build the remaining scripts that are related to your catalog. This will enable you to track product or content views, in-site searches, category views, shopping carts and purchases.

All of these scripts rely on the connections with your catalog.
The trackPageview call is the most common, and can capture three types of information: product/content views, categories views, or search views.

<script type=”text/javascript”>

_etmc.push([“setOrgId”, “MID”]);
_etmc.push([“trackPageView”, { “item” : “INSERT_PRODUCT_CODE” }]);
Simply replace INSERT_PRODUCT_CODE with the attribute you want to match. This is normally the product code or SKU in your catalog.

Cart and Purchase tracking enables you to activate abandoned shopping cart campaigns. Purchase data will provide you with very effective recommendation scenarios, like “people who bought also bought/viewed”. The more data you track, the better your recommendations will get. Once web development has implemented all Collect Codes, go to the Web or Email recommendation section in Marketing Cloud and open Status. This will show you the Einstein Status Console where you can monitor the Collect Tracking Code Status and Catalog Status. If data is tracked correctly, you will see the collected data number increasing per tracking code. The status should be Green and OK for every tracking section.

Personalization Builder


Once everything is working, start comparing the numbers with your web analytics to assess whether the scripts are doing their job. If the results seem too high, you should probably review the script execution. If you are not a developer you can use a web browser like Chrome to inspect your website, look at the sources and monitor which scripts are executed and when. This will provide valuable feedback for your web developer.

Am I done with the setup of Einstein now?

Almost … just one more step to go. You will want to store all tracked data in data extensions, so you can use these for selections and journeys. Remember that you now know when somebody was on your site, which products they viewed and what his or her affinities are.

Step 4

Turn On Einstein Recommendations Data Extensions. Follow these steps to enable Einstein to populate data extensions in Contact Builder.

1. Navigate to the Status tab in Personalization Builder.
2. Click the grey Settings cog to reveal the drop-down menu
3. Click Data Extension Settings.
4. Toggle on Enable Einstein Data Extensions.
5. Click Save.

Personalization Builder


What happens next?

Marketing Cloud begins collecting data immediately after you implement the Collect Code on your website, but it may take up to one month to detect enough activity to power the algorithms, depending on your website traffic.


What’s next? Read part 2, where we dive deeply into recommendation scenarios, rule manager and how to integrate these recommendations in emails and web pages.


One thought to “Einstein: the setup in Salesforce Marketing Cloud”

Comments are closed.