Last updated at Mon, 06 Nov 2017 20:23:41 GMT

Typically, most logging activity in the online world is concerned with collecting information about an enterprise’s digital infrastructure. Machine logs, application logs, network logs, database logs, access logs are a few examples of such activity. However, as marketing campaigns become more integrated into application activity, using log data to monitor and to measure the effectiveness of a campaign is a viable extension of an enterprise’s current logging activity.

But, we need to beware.

Usually machine, server and application logging is continuous. It’s never meant to end. Also, this type of log data can be about a wide variety of sometimes disparate activities. For example, [CRITICAL, Disk Full] and [INFO, Bob logged in]. Marketing campaign logging is a different beast. The length of a marketing campaign is finite. A campaign begins, a campaign runs and a campaign ends. Also, the purpose of campaign logging is to provide data in order to understand if and how a campaign’s goals are being achieved. The difference is subtle but important. When it comes to machine logging, you are not planning on an outcome. When logging a marketing campaign you are. Thus, logging for marketing campaigns requires a different type of planning.

So, how do we plan for an effective Log Enabled Marketing Campaign? I suggest that you follow these 4 steps.

  1. Determine measurable key indicators of success
  2. Determine your campaign events
  3. Plan the structure of your log entries
  4. Plan your collector queries

Who is the intended reader for this article?

This article is intended for the modern Marketing Professional. In addition to being able to analyze markets and design campaigns to penetrate markets, the modern Marketing Professional understands the techniques and value of data generation and collection in the digital economy. This article is intended to provide the basic understanding necessary for modern Marketing Professionals to plan and enable useful, structured logging relevant to an online marketing campaign.

I am going to elaborate on the 4 steps in a bit. But, before I do, please allow me to present the marketing campaign that will serve as the example we reference throughout the remainder of the article. The campaign is titled, The Free T-Shirt Campaign. The description is as follows:

The Free T-Shirt Campaign

The Free T-Shirt Campaign is a marketing campaign by which a potential customer is sent an email that contains a coupon code. The email invites the custom to go the company’s web site to make a purchase of its new product, SuperGizmo. When the customer enters the coupon code at checkout, he or she is given a 10% discount off the price of a SuperGizmo plus a free T-Shirt. The customer can choose from size S, M, L, XL, XXL.

Later, 10 days from purchase of SuperGizmo, the customer will be sent a satisfaction survey email asking him or her to rate product satisfaction, 1 to 5, 1= bad, 5= excellent, or No Opinion.

The coupon will be good from 30 days of receipt. The campaign will run for 14 days after commencement.

The key indicators of success are:

  • 3% of the prospective customers receiving an email will use the coupon to get a T-Shirt.
  • Half of the purchases of SuperGizmo will have an associated coupon code.
  • 10% of those buying SuperGizmo using the coupon will respond to the satisfaction survey
  • The overall satisfaction score average by those taking the survey will be at least 2.7

Again, we’ll use this sample campaign throughout the remainder of the article.

Determine measurable key indicators of success

As I mentioned at the beginning of this article, marketing campaigns are about achieving one or many goals. For example, we want might want a certain market segment to know more about our company or product. Or, we might want to sell more of a certain product or have people think about our product and service in a certain light. Because we know the goals of our campaign from the beginning, before we start our campaign, we can develop ways to measure that we have achieved our goals. In fact, we should establish what and how we will determine that we have achieved our goals. Creating a marketing campaign without pre established goals is bad business. The popular term for understanding the goals of a marketing campaign is to determine the key indicators of success.

Key indicators of success (KIS) are measurable and thus, need to be described by one or more numbers. Examples of key indicators of success are that I ran 5 miles, I sold $1000 in product, I had 5000 people viewing my blog. Either I made quota or I didn’t. I ran the distance or I didn’t. I achieved my desired readership or I fell short. There is no ambiguity.

The important thing to understand is that all key indicators of success are measurable. If you have a KIS that appears to be subject to opinion, you need to take a closer look. Most likely upon closer analysis the KIS can be expressed in one or a few values: a number, a selection from a list of choices, or true/false, to name a few.

If you find that expressing the KIS can be done using only free form text, at some point you are going to have to interpret that information. Does the text reflect a positive response? How many time does a particular word appear in the text? How many words are in the response. At the end of the day you’ll find yourself extracting KIS metrics from the text. The good news is that even in free form text, there is information waiting to be discovered. The bad news is that extracting such information requires significant technical skill and time. It’s easier to use simple measurements from the gitgo.

As you might remember from our example Free T-Shirt Campaign above, the key indicators of success are:

  • 3% of the prospective customers receiving an email will use the coupon to get a T-Shirt.
  • Half of the purchases of SuperGizmo will have an associated coupon code.
  • 10% of those buying SuperGizmo using the coupon will respond to the satisfaction survey
  • The overall satisfaction score average by those taking the survey will be at least 2.7

The nice thing about these KISs is that because they are numbers, we can create formulas to apply to our log data in order to determine the success of a KIS. We can create the formulas before we start the campaign. However, we have to do some work before we can create the formulas that will determine the validity of our KISs. First we need to segment our campaign into events and then we need to structure data around those events.

Determine your campaign events

A log is made up of log entries. You can think of log entry as a description of an event. For example, when an application runs out of memory, typically an application makes an ERROR entry to a log. The log entry will probably have the term ERROR somewhere in the line and Out of Memory as a description. But, when you think about it conceptually, you are logging an error event.

Most marketing campaigns are organized according to events. You can have a single event campaign such as an email blast. Of your can have a campaign that has multiple events. For example, we might have an email blast, along with a television commercial and some online ad placement. In this case we have 3 events.

The examples above are simple. Our Free T-Shirt Campaign example is more complex. This campaign has four events. These events are described in Table 1, below.

EventDescription
Coupon Email SentEmail sent to prospective customer that provides a coupon code for SuperGizmo and 10% discount
Coupon Used at CheckoutCustomer uses coupon code to get T-Shirt and discount. Customer declares T-Shirt size.
Survey Email SentEmail containing link to survey gets sent to SuperGizmo purchaser
Survey TakenSuperGizmo purchaser takes survey

Table 1: The campaign events that will be logged as during The Free T-Shirt Campaign

The reason that it is important to determine your campaign events during your planning stage is because each log entry you make will describe a particular event that is part of the campaign. But, there is no saying all entries will come from one source or within the same time frame. For example, considering Table 1 above, the log entry for the Coupon Email Sent event might come from a bulk blast service or application on Monday, while the log entry for Coupon Used at Checkout log entry might be submitted from a web application 5 days later. Yes, these sources might be submitting to the same log service, such as Logentries. But there is nothing that says everything is going to be all together at the same time. However, if you know from the beginning the events you are logging, life is going to a be lot easier when it comes time to aggregate your log entries for sensible analysis. If you know your events, you can anticipate them. And, if you understand the log entry structure associated with a particular event, life will become even easier.

So, let talk about planning your log entry structure.

Plan your log entry structures

Once you determine your campaign events, you need to define the structure of the log entry for each event. Yes, I know In the old days, structuring log data used to be the work of engineering staff. However, as marketing campaigns become much more technical and data oriented, being able to structure your campaign data is not nice to have for a marketing professional. It’s becoming a requirement. However, being able to structure data is not a skill you are going to pick up overnight. It takes time. So for now, you might want to enlist the aid of a few database developers. Structuring data is their bread and butter. And, when presented with an eager student, most database developers are happy to share what they know and then some.

The reason we want to structure our log entry data is to make it easier to work with when it comes time to doing analysis. Structured data is easy to index. When data is indexed, you can do more analysis, faster.

Table 2 below shows the data points for each event in the Free T-Shirt campaign. I arrived at this table by analyzing the description of the campaign at the beginning of the article.

EventData Points
Coupon Email Sentl Event Typel Campaign Id

l Email Send Date

l Email SendTo Address

l Coupon Code

Coupon Used at Checkoutl EventTypel Purchase Date

l T-Shirt Size

l Total Purchase

l SuperGizmo Serial Number

l Customer Id

Survey Email Sentl EventTypel Email Send Date

l Email SendTo Address

l Coupon Code

l Customer Id

l SuperGizmo Serial Number

Survey Takenl EventTypel Survey Taken Date

l Customer Id

l SuperGizmo Serial Number

l Survey Rating

Table 2: The data points that will be logged for the given campaign event

As you can see by looking at Table 2, above, some data points are explicitly described in the campaign description, others are inferred. As mentioned above, if you are new to working with data structures, you’ll do well to enlist the help of a database developer during this step. Mastery takes time and experience. But, it’s time well spent. Remember please, structured data is an order of magnitude easier to work with than the alternative.

The next step is to translate the data points you determined for your events into a consistent log entry format that supports your data structures.

The best thing to do is use a popular, common format. Presently the two most common formats around are JSON or Key-Value Pair (KVP). You can read up on the details here for JSON and here for KVP.

Both formats can express your data structure within a single log entry line. For example, let’s take a look at the first campaign event, Coupon Email Sent, as described above in Table 2. The following example is a JSON structure describing the event, with some fictitious data attached.

{"eventType": "couponEmailSent","campaignId": "supergiz01","emailSendDate": "2016-02-09 00: 00: 00""sendTo": "somebody@cool.com","couponCode": "XZ989QQ"}

Here is the same data expressed as a Key-Value Pairs:

eventType=couponEmailSent,campaignId=supergiz01,emailSendDate=2016-02-09 00: 00: 00,sendTo=somebody@cool.com,couponCode=XZ989QQ

The important thing to understand is that both JSON and Key-Value Pair formats are self-describing and can be submitted to a log as a single line of text.

Why do some places show JSON as a multi-line format?

Many times you will see JSON displayed in multi-line manner, like so:

{ "eventType": "couponEmailSent", "campaignId": "supergiz01", "emailSendDate": "2016-02-09 00: 00: 00", "sendTo": "somebody@cool.com", "couponCode": "XZ989QQ" }

Although the JSON appears to be written on many lines, when it comes time to log JSON, the real log entry will be as a single line of text, like so:

{"eventType": "couponEmailSent","campaignId": "supergiz01","emailSendDate": "2016-02-09 00: 00: 00""sendTo": "somebody@cool.com","couponCode": "XZ989QQ"}

The tools that render JSON for viewing or editing are smart enough to insert line breaks and indents in order to make the format more readable to humans.

Once you determine your log events, the data points associated with those events and format by which data will be submitted, the logging begins.

Formatted data is self-describing

Data formats such as JSON and Key-Value Pairs are self-describing. Consider this log entry:

1,2,3,4

as opposed to this:

room=1,level=2,row=3,seat=4.

In the first example, which is unformatted save for comma separation, you have to know a lot about the log entry beforehand in order to make sense of the data. In the second example, the entry tells you not only the data, but what the data is about. Thus, the second is a self-describing format.

Please know that in larger enterprises, the actual work of implementing logging is typically done in engineering groups. However, recent trends show that DevOps thinking– the interdepartmental, unified approach to software planning, development and deployment– has blurred many lines of responsibility. Yes, it’s still going to be rare for marketing professionals to add logging code or logging agents to production software. However, as groups work more closely together around the definition and deployment of initiatives, those marketing professionals that can really participate as educated partners in the digital domain will increase the respect given to their calling and their value to the team overall.

How to submit log data

There are a few ways to submit log data. You can use an agent embedded in a server or you can have log data submitted from within an application. Logentries supports both techniques as well as others.

Now that we have planned our log structures, let’s move onto collectors.

Plan your collector queries

Collecting log data and then planning how to analyze that data is where the rubber meets the road in terms of creating an effective log enabled marketing campaign.

In the previous sections I invited you to think about a log entry as a description of an event in time. Each time a marketing event occurs, a log entry that describes that event is sent to a logging point where it is collected, indexed and stored. The place where that log entry is sent is called a collector. In the old days the collector might be code that saves a log entry to a file on a machine’s hard drive or sends the log data as an email to an email server that in turn forwards the email to a virtual recipient. However, the trend among modern enterprises is to send log entries via HTTP to a service provider such a Logentries. (Please see Figure 1, below.) The provider accepts the entry and then parses and indexes the entry accordingly.

Marketing-Log-Data-To-Endpoint

Figure 1: Well structured log data sent to a common end point, such as Logentries, is a typical means of collection in the modern enterprise.

It is during collection where the work we did structuring and formatting the log entry for a campaign event bears fruit. As mentioned above, a modern collector provides a lot of automagic. For example, when you send structured log data into Logentries in JSON format, intelligence within the collector will parse out each attribute and associated value in the JSON structure. In addition, the collector automatically indexes the attribute. The same is true when you use a Key-Value Pair format. Performing analysis on indexed data is easier and faster than working with unstructured data.

However, working easier really doesn’t matter unless you know what you are trying to learn. And, this is where having a clear idea about how to convert the collected data into useful information you can compare to your Key Indicators of Success becomes critical.

In a modern collector, such Logentries you execute queries against the log data to elicit information. Querying a collector is similar to querying a database. For example, for the KIS, the overall satisfaction score average by those taking the survey will be at least 2.7, you will run a query that implements the logic:

“get all the log entries in which eventType = surveyTaken and get the average of the attribute, SurveyRating among all the retrieved entries.”

You take the average that is returned by the query and compare it to your key indicator of success. If the average exceeds 2.7, you met your goal.

You’ll find that each of your key indicators of success will be represented as a query on a collector. Of course, there is nothing written in stone that says you need to plan your queries in advance. But, when you do, you’ll find that your process becomes self-reinforcing. In other words let’s say you define a KIS, plan your campaign events and structure your event data accordingly. Then you come to a place where you find you cannot not write a query against the log data that gets you the information you want, you know you have a problem. Either the key indicator of success is not defined properly, the data structure does not support the KIS, or you have neglected to properly identify a campaign(s) event to support the KIS. This is not a bad thing. Being aware that you have a shortcoming and providing remedy before the campaign starts is a whole lot better than trying to put in fixes as data is being submitted or the campaign comes to a halt. As said in the School of Lean Startup, fail often and fail early.

Putting it all together

Log enabled marketing campaigns allow you to measure the success of your marketing efforts easily and accurately provided that you plan accordingly. Implementing a 4 step process in which you establish key indicators of success, plan your campaign events, structure your log entry data and finally plan the queries you will execute against a collector that has parsed and indexed the data is a self-reinforcing activity. Each step in the process corrects a previous step should something be amiss.

Marketing campaigns in which key indicators of success can be compared against results gathered from well planned log data provide the information you need in order to know that you are meeting the goals of your campaign. There is little downside to implementing a log enabled marketing campaign provided that you take the time to plan properly and use your information wisely.


Ready to implement a log enabled marketing campaign? Get started with Logentries for free!