Digital Marketing in practice (final episode)

In our last episode of the series we have spoken of the holy grail of Digital Marketing landscape and how this is deeply connected to the identity of our customers. So let’s try to recap for a moment what we need :

  1. all our customer data (web logs, app logs, purchases, calls, surveys,etc…) marked with same identity Id in order to proper assign every event to the same customer and we need this data to be collected in real/near real time.
  2. to define what are our targets (sales, customer satisfaction, market penetration,etc..) and define a strategy to reach those goals.
  3. To define the strategy we use the data collected at point 1 to identify the patterns that are leading to : high revenues customers, abandoned carts, poor reviews, good surveys,etc….
  4. Once our overall strategy (sales, discounts, promos, coupons, social,etc.. ) is defined we need to put this strategy in practice defining our customers journeys, for example look at this or this , so literally we have to define on each touch point (where), what and when some “actions” will happen, who will be the target of those actions and what are the subsequent “sub actions” or steps that automatically have to happen at every step of the journey.
  5. To produce on all the touch points the respective UI associated to the actions.
  6. To go back to Point 1, evaluate the new data and check if the strategy is working and if necessary take the corrective actions.

Now in an hypothetical “perfect world” we should be finished,  but reality is much more complicated than that 🙂 .

rality check ahead sign

In fact , while we can define journeys and customer segments, profiles and target audiences , we need some “binding” to happen between our defined journeys and the real touch points.

An example? Let’s assume we define a coupon/loyalty initiative, this only means a quite large list of system configurations and actions :

  1. Define the new coupon initiative in the loyalty system
  2. Define the budget allocated for those coupons and the limits associated
  3. Integrate the new coupons with the e-commerce in order to have them to be applied and accepted at order time
  4. Integrate the journey builder actions into the e-commerce in order to have the e-commerce UI display the promotion new look & feel
  5. Integrate into e-commerce UI engine journey builder sub-steps if any
  6. Tag properly all the consumer journey steps in order to collect back the data points of the journey
  7. Etc..

Now repeat this for the marketing campaign system that handles email, sms and notifications, repeat this for the call center,etc….


As you can imagine we need a single unified collection of products (identity,e-commerce, apps, crm, marketing email/sms, etc…) all connected by the same vendor and the “unified data collector system” to be also the customer journey builder , in fact we can reasonably understand if our strategies are effective only if we can observe on the very same tool if the journeys we designed are working or not (what if we define a journey of 12 steps and almost nobody goes after step 3 ? ).

I guess that if you look now on preferred search engine and do so basic research you will find at least 20+ vendors that are saying that they have this kind of combined solution in place.

In reality , even if we assume that all the 20+ vendors have all fantastic and well connected platforms, all the enterprises have already a gargantuan amount of systems already in place and you cannot “turn off” everything and start from the scratch.

At the same time even if you start from zero, often the cost and the lock in risk associated with ALL IN ONE solutions are so high that you can anyway end up going to think about a Lego approach.


So what is our recommendation here ?


The right approach can be perhaps neither build or buy , I call it smart integration.

Smart integration means the following:

  1. Define your own MML : marketing markup language
  2. From the central data repository define the personalized MML journey for each customer
  3. Write this MML journey on the identity of each customer
  4. Build/Configure on all the touch points the functionality needed to read the MML journey (leverage first the customer device/browser to perform the integration) from the identity itself ,translate that in meaningful actions on that specific touch point (email template on marketing automation, call center Next Best Action on the CRM, etc…)
  5. Collect all the data and evaluate , correct and start again 🙂

An example of MML?

You can start simply with something like this:


Now if you want to create a unified MML definition for the main strategies and touch points , I think it would be a fantastic idea and for sure a very successful start up!



Digital Marketing in practice (part 4)

We finished part 3 defining the need of a customer identity provider that can seamlessly be integrated in all our touch points , but this also means that we can personalize our front ends only when our customers logins with our identity provider.

Can we personalize the appearance and the offers of our front ends without requiring the user to login?

If we look back to part 2 during the RTB the combined systems essentially do this job , because they recognize the user with a cookie or by device Id and they trigger the “right” advertising for him according to his profile (the real time auction is triggered only on the brands/campaigns that have this user profile in their target audience) .

Can we use cookies/device ids to do the same?

In reality we can do even more than that, because of the following : while DMP can “see” the same customer as two or more different customers because he uses a laptop with different browsers and a smartphone (in reality DMP uses a very sophisticated algorithms to match cookies and devices ids with IP addresses and other variables to remove ,when possible, duplicates and build unified profiles…) since we have an identity provider in place , when the customer logins we can match the same identity Id with all the different device ids and cookies ids and target correctly the very same customer.

However again , we don’t want to build completely from the scratch such a complicated system, and there are options available on the market .

We can ,for example, leverage Google Analytics (GA) Id coupled with our Identity Id as GA Crm Id (some examples are listed here) and use this combo to provide personalization even when customers are not logged (ga Id–> Identity Id–> customer identified).

Of course we need to store this relationship somewhere and the nosql structure of the identity provider can be a nice place (but it will not be so simple as you can imagine 😉 ).

Another way to do it is to have the personalization/promotion engine directly integrated with a DMP and use the DMP segments to define the personalization on the front-end, but this, if we plan to leverage correctly our identity provider, it is not a good idea.

If instead you plan to have a “no-registration/login” website, this technique can be really useful.

Now if we assign to each customer one or more “tags” where , for example we say if the customer is Gold, Bronze or Silver:

and we write those tags directly into the identity record of the customer, what will happen it is that any front-end that is able to read from the identity provider , can also do personalization and promotions looking at those tags, right?

And since the identity is the same across all front-ends, we can have always the right personalization for our customers right?

Well in theory yes , in practice we need something more to achieve this:

1) A personalization / loyalty / promotion engine on the front end that usually reads from front end db

2) A push down operation that copies the “tags” from the identity provider to the local front end

3) A magic system that writes to the identity provider the “right tags” for each customer and also coordinates what “gold/silver/bronze” mean for all the various actors :

  • what is the email template for a gold customer?
  • what is the discount for a bronze one in the e-commerce shop?
  • what silver means for the smartphone app?

If you pick the right identity provider and the right front ends the steps 1-2 should be only some minor configuration to do on the identity provider adapter for that front end.

Step 3 it is the holy grail of the overall landscape and we will look at it in the next part.

Digital Marketing in practice (part 3)

In the first and second part of this series we enumerated already several systems that we need to have in place to actually drive our digital shop of toys:

E-commerce (this alone it is a universe of components like payment gateways, web log analytics, social integrations, rating & reviews , coupons/promotions etc …) , supply chain, crm , marketing platform and last but not least the DMP with all the pieces and integrations .

How to manage all those platforms and how to integrate them?

How to perform something “simple” like define a campaign with promotion and special look & feel and have this promotion displayed only to the special customers irrespective if they browse the e-commerce site or they are on the Facebook page or they use the iPhone/Android app? And what if we want this to happen only x times to each specific customer and after that do not appear any more?

What if we want to do this for N (let’s say N=30 or 300) customer groups?

If we have 4-5 or more front ends (e-commerce, app Iphone, app Android, social pages, marketing emails, etc…) do we have to perform 5×300=1500 ui changes (1 for each combination of ui and customer group) ?

How do we recognize the same customer across different front ends in order to offer him the right promotions (multi channel)?

And if we add also retail stores (our own retail stores) into the mix (omni-channel) ?

What is the cost if we do this in the wrong way?

Finally one of the most desired features: Can we have a customer group journey builder and on each step of the journey decide what will happen on all the touch points (front ends) for those customers?

Those questions are usually the bread and butter of all the digital marketing and sales departments trying to serve their clients with the best of breed available technologies but at a reasonable cost , not only in terms of licensing and customization but mainly in terms of maintenance and integration costs.

In fact a “build” approach for those scenarios is simply impossible not only from a budget perspective but principally from a time to market perspective.

In order to proceed and propose some feasible approaches we need first try to figure out what are our key enablers that can help to simplify our landscape .

A first consideration is the following:

If we want to provide the same “service” to our customers on different touch points, we need to recognize customers in those front ends in the very same way.

One way to achieve this is to assign and reuse for each customer a unique identity that can identify him across all channels.

Ideally we need an identity solution, with hashing, encryption, cyber threat detection, multi factor authentication, social logins, etc…

More importantly we need an identity provider that is “plug-gable” in our e-commerce, apps and other touch points.

Assuming that our identity provider is in place (here a list of possible vendors) we can already offer very nice features and obtain very important benefits:

1. We do not manage passwords, we offload almost completely the identity security and compliance to our identity provider

2. We can offer social or sms login so people do not have to remember new passwords but they can re-use identities that they already have.

3. We can leverage identity provider advanced features like: progressive profiling (ask info to our customers at the right time and not all in once at registration time), identity sso across multiple touch points (if you are already logged in website A you are also automatically logged in website B) , conditional multi factor authentication (mfa), mobile app with qr code scan for mfa instead of sms, etc…

4. Identity forms (registration, password reset, login/multi factor login, etc) managed centrally once for all in the identity provider. Defined once, used in all the touch points.

5. Custom schema: in addition to the usual username/userid etc… modern identity providers give you also a flexible schema for customer identity data that you can leverage for multiple purposes. We will see the value of this soon..

In the next part we will look in the architectural benefits that this choice can bring and how we can leverage this to deliver the previously discussed features.

Send Emails with Adobe Campaign Marketing Cloud (Neolane)

Hi this time instead of downloading data from Neolane or updating recipients in it , we want to use Neolane as email cannon leveraging its powerful template engine to manage the email look & feel and deciding on the fly ,using Neolane API, the targets of our mass email campaign.

So the use case is the following : define in Neolane an email template with some fields mapping and leverage Neolane API to send email using this template but defining the email recipients externally and also the contents of the mapped fields .

According to the official Adobe documentation this can be done using the Neolane Business Oriented Apis (we looked into the Data Oriented Apis in our previous articles) as specified here:

Unfortunately the documentation is not really clear/complete and I had really to dig inside adobe logs, error codes and soap responses to have this working properly, and here is some sample code that can help you.

The code is made using the sample provided inside the Adobe documentation (external file mapping with data coming from the CDATA section inside the delivery xml tag structure).

Here the c# code:

 string sessionToken = "Look at other Neolane Code samples on how retrieve the session token";
 string securityToken = "Look at the other Neolane Code samples on how retrieve the security token";

string scenario ="Write here the internal name of the delivery template";

 HttpWebRequest reqData = (HttpWebRequest)WebRequest.Create(adobeApiUrl);

 reqData.ContentType = "text/xml; charset=utf-8";
 reqData.Headers.Add("SOAPAction", "nms:delivery#SubmitDelivery");
 reqData.Headers.Add("X-Security-Token", securityToken);
 reqData.Headers.Add("cookie", "__sessiontoken=" + sessionToken);
 reqData.Method = "POST";


 string strWriteHeader = "<?xml version='1.0' encoding='ISO-8859-1'?>" +
 "<soapenv:Envelope xmlns:soapenv=\"\" xmlns:urn=\"urn:nms:delivery\">" +
 "<soapenv:Header/>" + 
 " <soapenv:Body>"+
 "<urn:SubmitDelivery>" +
 "<urn:sessiontoken>" + sessionToken + "</urn:sessiontoken>" +
 " <urn:strScenarioName>" +scenario+ "</urn:strScenarioName>"+

 string strWriteRecipientBody = "<delivery> " +
   "<targets fromExternalSource=\"true\"> " +
           "<externalSource><![CDATA[MsgId|ClientId|Title|Name|FirstName|Mobile|Email|Market_segment|Product_affinity1|Product_affinity2|Product_affinity3|Product_affinity4|Support_Number|Amount|Threshold " + 
"1|000001234|M.|Phulpin|Hervé|0650201020||1|A1|A2|A3|A4|E12|120000|100000]]></externalSource>" +
          "</targets> " +
 string strWriteFooter = " </urn:elemContent>" +
 "</urn:SubmitDelivery>" +
 "</soapenv:Body>" +

 string bodyData = strWriteHeader + strWriteRecipientBody + strWriteFooter;

 byte[] byteArrayData = Encoding.UTF8.GetBytes(bodyData);

 // Set the ContentLength property of the WebRequest.
 reqData.ContentLength = byteArrayData.Length;
 // Get the request stream.
 Stream dataStreamInputData = reqData.GetRequestStream();
 // Write the data to the request stream.
 dataStreamInputData.Write(byteArrayData, 0, byteArrayData.Length);
 // Close the Stream object.

 var responseData = reqData.GetResponse();

 Stream dataStreamData = responseData.GetResponseStream();
 // Open the stream using a StreamReader for easy access.
 StreamReader readerData = new StreamReader(dataStreamData);
 // Read the content.
 string responseFromServerData = readerData.ReadToEnd();

 // Clean up the streams and the response.

return responseFromServerData;

Integration with Adobe Campaign Marketing (aka Neolane) Part II

Hi in the previous post we saw how to read information from Adobe Campaign Marketing.

This time I want to show you how to “write” to it, in particular how to add or modify recipients . This is , I believe, something that you want to do regularly to have in sync , for example, your users preferences on your sites and their current status on your campaign database . In fact a user that removes from his profile on a site the consensus to receive a specific newsletter imagines that automatically , from that moment, he will never be disturbed again. If you do not sync this asap, you have the risk to contact someone that does not want to be contacted . On the other side, if a new user registers on your site you want asap to have in your campaign tool to target him .

Here the c# code:

string adobeApiUrl = ConfigurationManager.AppSettings["adobeApiUrl"];
//Here for testing purpouses username and password are simply read by conf settings but you should acquire it in a secure way!
string adobeUser = ConfigurationManager.AppSettings["adobeUser"];
string adobePass = ConfigurationManager.AppSettings["adobePass"];
//We need to write recipients but they stay inside a folder so we have to know in advance the folder id or name
string adobeFolderId = ConfigurationManager.AppSettings["adobeFolderId"];
//Create the web request to the soaprouter page
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(adobeApiUrl);
req.Method = "POST";
req.ContentType = "text/xml; charset=utf-8";
//Add to the headers the requested Service (session) that we want to call
req.Headers.Add("SOAPAction", "xtk:session#Logon");

string userName = adobeUser;
string pass = adobePass;
//We craft the soap envelope creating a session Logon reequest
string body = "<soapenv:Envelope xmlns:soapenv=\"\" xmlns:urn=\"urn:xtk:session\">" +
"<soapenv:Header/><soapenv:Body><urn:Logon>" +
"<urn:sessiontoken/>" +
"<urn:strLogin>" + userName + "</urn:strLogin>" +
"<urn:strPassword>" + pass + "</urn:strPassword>" +
"<urn:elemParameters/>" +
//We write the body to a byteArray to be passed with the Request Stream
byte[] byteArray = Encoding.UTF8.GetBytes(body);

// Set the ContentLength property of the WebRequest.
req.ContentLength = byteArray.Length;
// Get the request stream.
Stream dataStreamInput = req.GetRequestStream();
// Write the data to the request stream.
dataStreamInput.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.

var responseAdobe = req.GetResponse();

Stream dataStream = responseAdobe.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
// Clean up the streams and the response.
//Manually parsing the response with an XMLDoc
System.Xml.XmlDocument xResponse = new XmlDocument();
// We parse manually the response. This is again for testing purpouses
XmlNode respx = xResponse.DocumentElement.FirstChild.FirstChild;

string sessionToken = respx.FirstChild.InnerText;
string securityToken = respx.LastChild.InnerText;

// We have done the login now we can actually do a query on Neolane
HttpWebRequest reqData = (HttpWebRequest)WebRequest.Create(adobeApiUrl);
reqData.ContentType = "text/xml; charset=utf-8";
//Add to the headers the requested Service (persist) that we want to call
reqData.Headers.Add("SOAPAction", "xtk:persist#Write");
reqData.Headers.Add("X-Security-Token", securityToken);
reqData.Headers.Add("cookie", "__sessiontoken=" + sessionToken);
reqData.Method = "POST";
//We craft the soap header also here session token seems to be needed
string strWriteHeader = "<?xml version='1.0' encoding='ISO-8859-1'?>" +
"<soapenv:Envelope xmlns:soapenv='' xmlns:urn='urn:xtk:session'>" +
"<soapenv:Header/>" +
"<soapenv:Body>" +
"<urn:Write>" +
"<urn:sessiontoken>" + sessionToken + "</urn:sessiontoken>" +

string strWriteRecipientBody = string.Empty;
string strWriteFooter = "</urn:domDoc>" +
"</urn:Write>" +
"</soapenv:Body>" +
//Here I loop inside a list of objects that represent the adobe recipient I want to write
// operation is insertOrUpdate and the key that will check if it is an insert or an update is the email in my case.
// you can pick the one that you think is good

foreach (AdobeRecipient recipient in updatesOnAdobe)
strWriteRecipientBody +=
"<recipient "
+ "_operation='insertOrUpdate' "
+ "_key='@email' "
+ "xtkschema='nms:recipient' "
+ "account='" + recipient.account + "' "
+ "lastName='" + recipient.lastName + "' "
+ "firstName='" + recipient.firstName + "' "
+ "email='" + + "' "
+ "origin='" + recipient.origin + "' "
+ "company='" + + "'>"
+ "<folder id='" + recipient.folderId + "'/> "
+ "</recipient> ";

//Full String ready to be passed
string bodyData = strWriteHeader + strWriteRecipientBody + strWriteFooter;

byte[] byteArrayData = Encoding.UTF8.GetBytes(bodyData);

// Set the ContentLength property of the WebRequest.
reqData.ContentLength = byteArrayData.Length;
// Get the request stream.
Stream dataStreamInputData = reqData.GetRequestStream();
// Write the data to the request stream.
dataStreamInputData.Write(byteArrayData, 0, byteArrayData.Length);
// Close the Stream object.

var responseData = reqData.GetResponse();

Stream dataStreamData = responseData.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader readerData = new StreamReader(dataStreamData);
// Read the content.
string responseFromServerData = readerData.ReadToEnd();
// Here we should receive an OK from Neolane
// Clean up the streams and the response.

return responseFromServerData;

Cross-channel personalization with Adobe Marketing Cloud

This is a sample scenario that we want to reproduce:

Meet John. John wants to buy a new car. During his lunch break he uses his iPad to look at a manufacturer website and finds a model he is interested in.  He engages with the content but then his lunch break ends! He leaves the site and continues with his working day.

The following weekend, with more time on his hands, John returns to the website.  John is recognised as a returning visitor and the data held on him is interrogated. It is known that he did not sign up for the manufacturers newsletter on his previous visit so the landing page is personalised to prompt him to sign up.  Also, the vehicle that he was interested in is given prominence on the site.  John follows the prompts and signs up to the newsletter.

One week later John receives an e-mail, but he is busy with his work and he doesn’t open the e-mail before the evening. By this time he is really tired and doesn’t click through to the website from the newsletter. He puts down his iPad and goes to bed.

Based on John’s previous behaviour, the next newsletter is sent to him on the evening. John opens it and as it focuses on the vehicle he has already expressed an interest in, he clicks through to the website. The website recognises him and displays information about where and when he can test drive his preferred vehicle, along with an incentive to do so. John follows this link and books a test drive for the next day.

Source :


These are the steps to perform all the actions described inside the scenario:


Indeed all the integrations are not super simple and they strongly leverage API calls between the various modules, but now you have an idea on how to perform such personalization.


Marketing Segmentation & Predictive Analytics

Enterprises at any level need to target their consumers, clients, users with campaigns , measure the result of these campaigns and hopefully improve sales/contacts after each iteration. Practically this job requires a very broad spectrum of experiences starting from web/art/video design (how we format our message), going to language specific skills (how we write our message to raise interest) and of course some black magic art called segmentation (write the right message to the right potential or actual costumer). How marketing people build segments? Well using the attributes of the customers (age, sex, zip code, children etc…) they can create segments (for example all young women living in NY without children) and create campaigns for them (discounted shirts? Why not! ) . Now what is the role of predictive analytics in this area? Well in theory it should help marketing people really a lot: 

  • Discovering clusters (segments?) into the customer base
  • Identifying the key features or influencers that lead to buy an item or do some action
  • Showing what are the items  bought in combo and propose them as new packages to offer
  • Using social data identify leaders and followers into the customer base
  • ….surely  another hundred of insights like the ones mentioned.

Normally a marketing targeting tool leverages a classical database with tables, fields , records and actually the segmentation result it’s “just” a sql query that with some “where” conditions identifies the impacted customers. This tool it’s usually part of a suite, in other words from a vendor you buy a package with it and the package is made usually also of a CMS to build your web site pages, a eCommerce platform to sell your stuff on the net, an analytics/predictive analytics package to do the tasks described before. 

Looking at this , from a pure marketing department perspective, to maximize the value of your investments you should buy the package and enjoy the entire integrated platform without worries. It’s a bit like when you buy an iPhone and you start to enjoy it really when you couple it with an Apple TV, a MacBook and lately an apple watch. 

But while you can be the only one at home that takes this decision in medium/large enterprises you have several good reasons to do exactly the opposite:

1) predictive analytics runs on the largest possible combinations of data not only on the pure marketing/clicks/orders world.

2) it requires tools (big data clusters, in memory engines, complex algorithms, etc..) that are much more sophisticated  than the “normal” analytics capabilities provided by mkt packages . Usually it leverages best in class open source (R,Python,Scala libraries etc..) or specific vendor software (SAS, IBM,etc.. and lately several startups like Ayasdi etc..).

3) people working on it are miles away from marketing people from cab abilities perspective and from a target perspective (mkt usually want analytics to prove its guts feeling, analyst looks at data with curiosity trying to figure out patterns) 

4) From an analytics stand point  usually we want to buy software that we can reuse for all the business cases (supply chain, logistics, operations, etc…) and not only for the marketing business cases.

The usual “attempt to solve” this conflict it’s separation of diuties : analysts discover insights, they translate these insights into features of the customers and this info “should” fly to the segmentation tool and the good mkt guys should leverage these to do super effective campaigns. The result ? A huge amount of effort wasted without any ROI: 

1) mkt people do not own these features so they do not trust them or they simply ignore them

2) when you start the customization journey ( new interfaces that trasport data back & forth from analytics world to mkt planet) you will face bugs, data quality issues, data synchronization issues etc…

3) analyst try to cover multiple business cases as said, so only a fraction of his job it’s actually targeting marketing needs

When you are a startup however all the complications of this approach are mitigated by the fact that your team is small and mkt/analytics teams are in practice 2-3 people in the same room.

So we can apply the startup model everywhere?

The key factor here it’s people and objectives. We can go with a complete E2E marketing & predictive analytics integrated and customized solution but we have to add to it a dedicated team that works on it : creative marketing and data driven decisions can coexist and actually help each other if they are the result of a team of people laser focused on the same business objectives.

For large enterprises building this team is the key to provide  these capabilities as service to the various internal clients. Clients can be for example other marketing departments spread around the world in different countries working on different labels. These clients will benefit of this because they can focus really on their business at regional level and obtain not only an “agency like” service but they will benefit from the entire chain of experiences and results that data flowing at global level can bring.