Automating Salesforce Marketing Cloud

By Greg Gifford , Jason Hanshaw
    What do you get with a Packt Subscription?

  • Instant access to this title and 7,500+ eBooks & Videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Free Chapter
    Chapter 1: What Is Automation?
About this book

Salesforce Marketing Cloud (SFMC) allows you to use multiple channels and tools to create a 1:1 marketing experience for your customers and subscribers. Through automation and helper tasks, you can greatly increase your productivity while also reducing the level of effort required in terms of volume and frequency.

Automating Salesforce Marketing Cloud starts by discussing what automation is generally and then progresses to what automation is in SFMC. After that, you’ll focus on how to perform automation inside of SFMC all the way to fully running processes and capabilities from an external service. Later chapters explore the benefits and capabilities of automation and having an automation mindset both within and outside of SFMC. Equipped with this knowledge and example code, you'll be prepared to maximize your SFMC efficiency.

By the end of this Salesforce book, you’ll have the skills you need to build automation both inside and outside of SFMC, along with the knowledge for using the platform optimally.

Publication date:
April 2022
Publisher
Packt
Pages
456
ISBN
9781803237190

 

Chapter 1: What Is Automation?

Automation is something that has become so ingrained in our society that we almost take it for granted. It is in our daily activities and helps us to achieve so many of our wonderful and innovative inventions. The odd thing though is that despite automation being such a day-to-day thing, not many people can actually explain what it means or where it came from. To help get us all in the right mindset, we first wanted to go over what exactly automation and automation theory are.

In this chapter, we will cover the following topics:

  • Automation theory: A dive into the history of automation, the theory behind why automation is useful, and how it should be used
  • Defining automation: Solidifying the meaning behind our focus in the book by defining exactly what an automation is
  • Automation opportunities and pitfalls: A broad overview of the different benefits and potential risks that go along with automation
  • Concepts of automation: Basic concepts related to automation and the areas they affect
  • Implementation best practices: Some basic best practices related to automation when looking to implement it
  • Always Be Documenting (ABD): A case for why you should be documenting each automation and solution you create

With this knowledge, we will be prepared to move forward and fully digest the automation capabilities and possibilities related to Salesforce Marketing Cloud, as discussed further in this book.

 

Automation theory

In some ways, automation theory is a self-feeding theory in that as each advancement happens, it will use that step as a building block to making further advances to larger and more significant feats. This means that before we dig into the exact meaning of what automation is, we should look at the history of automation and automation theory over the years. This rich history is what built the automation theory and capabilities that we know and love today, and will give great insight into the future of automation as well.

From the development of the first computer, all the way to recent advances in AI, automation theory has had a significant and life-altering impact on humanity and history. Each one of these developments and inventions has helped forge the way for further automation and efficiency in an exponential way. These advances have created a steady push forward to remove all the manual aspects of any activity or process to help improve the speed, efficiency, and possibilities of the results.

We could probably even go all the way back to the very beginnings of mankind's rise to find the roots of automation theory. The very first automation could have been something as simple as the repeating loop our roaming ancestors took when hunting and/or gathering or even utilizing a tool or their environment to remove repetitive actions in their day-to-day life. Automation does not need to involve technology as we view it today!

Without automation theory, the computer would never have existed, changing the entire world we live in today. And that is only the most recent example of how automation has changed our lives. Look at the world's first moving assembly line for mass production created by Henry Ford (https://corporate.ford.com/articles/history/moving-assembly-line.html). Without that innovation, our entire world would be irrevocably different.

Automation theory has helped advance and shape technology and theories throughout the years, including such recent advances as the following:

  • Control functions (electronic digital computer)
  • Programming languages and capabilities (computers and machines)
  • A vast array of sensor technology (light, electromagnetic, kinetic, and so on)
  • Advanced mathematical theory of control systems (evolved during WWII)
  • Artificial intelligence (robotics and learning systems)

These advances have set the stage for the highly interconnected and digital world that we experience today. The simultaneous development and maturation of many technologies, in particular, information technologies, have enabled vast levels of interdependence and communication between previously disparate systems that were impossible before. While not a new feature of this development, automation has recently taken center stage in discussions about the future of business, communication, production, and many other aspects of our lives.

To help understand this, we wanted to provide a quick visual representation of automation theory as just described.

Figure 1.1 – Visual representation of automation theory

Figure 1.1 – Visual representation of automation theory

Now that we have a strong understanding of the history of automation and how it has affected our lives, let's figure out what exactly it is.

 

Automation definition

The dictionary defines automation as the technique of making an apparatus, a process, or a system operate automatically (Merriam-Webster: https://www.merriam-webster.com/dictionary/automation). That's a bit generic for our purposes, so let's consider it in an IT context so that we can make that more applicable to this domain. Automation is the use of repeated instructions to create a process that replaces previously used human intervention in order to accomplish a task. There, that's a bit better, right?

It has become a buzzword in our modern era, and its application has re-shaped the ways that we interact and live within our world. From home appliances to robotic rovers on other worlds, automation has found its way into the fabric of our technical and social world. In a world driven by speed, connectivity, and efficiency, it's not hard to see why it's become such a central focus of many organizations and technologies today.

One of the more obvious consequences from this transformative concept, and one relevant to this book, has been the dramatic shift in the ways that both business and individuals communicate and interact with each other in emerging digital spaces. As the rate at which aspects of our lives occur within these spaces increases, so has the expectations for instantaneous communication and services tailored to the personalized needs of individuals.

This has presented challenges for sure, but has also created tremendous opportunities for organizations that have embraced this digital transformation and have sought to redefine their business and processes to operate in this space.

This digital transformation has been critical for businesses to meet emerging customer demands and expectations, and has become a requirement to compete in this new global, digital world. This does not come without cost, however, and businesses today must be more cognizant than ever before of how their organization uses technology, both internally and externally.

One of the key components and performance multipliers in digital transformation is automation. Incorporating automation as a central feature in business processes, aside from introducing an innovative mindset to an organization, introduces efficiency in costs and performance that can have dramatic impacts when well planned and thoughtfully applied. In that vein, let's move onward to learn about the different opportunities and pitfalls that come along with automation.

 

Automation opportunities and pitfalls

Before diving further into the concept of automation, it's helpful to consider exactly why it can be such an important component of business processes and what risks are associated with its implementation.

First, automation is essential for reducing both financial and productivity costs associated with repetitive, time-consuming, and error-prone tasks. These could range from manual data-entry processes to complex monitoring or communication activities. In addition to its impact on these sorts of tasks, when well planned, it can introduce a single standard of quality that can be replicated and adhered to over time.

Opportunities

Let's take a deeper look into the benefits that can be extracted from incorporating automation into your business processes. First, I wanted to start with a quick visual to show the benefits and then from there, we will dive deeper into each aspect.

Figure 1.2 – Visualization of the benefits of automation

Figure 1.2 – Visualization of the benefits of automation

As you can see in each of the bars from the visual, there are a ton of great opportunities available. Now, let's take a deeper dive into these benefits.

Increased efficiency

One of the simplest benefits of incorporating automation is that it increases the efficiency with which tasks or events can be completed. When repetitive or time-intensive tasks are eliminated, it frees up resources to do more innovative and impactful work. This provides an immediate cost benefit as resources can be allocated to other impactful projects while also reducing the strain on employees, all without a loss in productivity.

Its impact in a customer-facing context can be even more beneficial. As customers demand real-time engagement and services, being able to meet them in the moment is critical. Whether it's automated communication for a password reset request, or a one-click online checkout, creating sustainable automated processes that can deliver on customer requests immediately is a massive benefit and has become an expectation in our digital world.

More reliable solutions

When it comes to any solution or project, consistent and reliable quality is an important factor for success. With manual solutions, where human input and decision making are ever-present and necessary for the completion of a task, there are risk factors that will inevitably impact the overall stability and reliability of the performance. Humans, while our capacities for attention and skill are prodigious, are subject to factors that will reduce work quality and performance. Whether it's a poor night's sleep, long periods of intense focus, or multi-tasking, attention to detail and performance will vary across individuals and circumstances.

This limitation provides an opportunity for automation. A well-defined, automated process suffers from no degradation of attention, nor experiences performance dips due to fatigue or distraction. In an interconnected global space, having an automated system that can operate 24 hours a day to meet challenges and complete tasks is important to a process that needs to be responsive on demand.

Expanded opportunities

While not initially apparent, automation can actually improve efficiency and productivity across teams in an organization by exposing the nature of your current business processes. Before a system can be automated, those underlying processes must be thoroughly analyzed in order to both define opportunities where automation is feasible and to define what it's meant to accomplish.

By exposing these underlying procedures, it encourages conversations about the current goals and future state of the program, which can help improve the overall quality and foster innovation.

In addition to this, automation can work as a centralizing force for many disparate processes that may otherwise be isolated and poorly understood. By combining data and workflows into a centralized system that is capable of both producing and receiving input or completing a task, you can act on events automatically and extend the capabilities of your solutions while increasing productivity.

Pitfalls

Now that we've covered just a few of the benefits that automation can bring to an organization, it's important to also consider the potential risks or downsides that can come from incorporating this as well.

High initial investment

It has been said that nothing in life is free and automation, unfortunately, is no exception.

First, there are the obvious financial costs that come with implementing automation solutions. Whether it's purchasing cloud storage, training for teams to learn new skills and adjust to new workflows, or just the amount of planning and development needed to implement the solution, the decision to automate a process should not be taken lightly.

Secondly, it is important to consider the opportunity and productivity costs that take away from other current or planned initiatives. Attention is a finite resource and draining it for a new initiative comes at the expense of other priorities.

When you carefully consider the amount of planning, development, testing, documentation, and training that can go into proposed automation, it can become daunting to undertake for some, and perhaps impractical for others.

Less ability to pivot quickly

We all know it's a perfect world, and all your solutions and initiatives are performing so well it's time to just set it and forget about it, right? Er, maybe not.

Even with the proper planning and strategies when developing automated solutions, unexpected shifts can leave your well-defined process at a disadvantage. Perhaps it's an urgent marketing need, or a new legal requirement that must be implemented to stay compliant, but automation can make you inflexible at an inopportune time.

By their nature, automated solutions are likely narrow and well-defined, which can leave them vulnerable to sudden shifts in goals that invalidate the existing implementation.

You get out what you put in

It seems self-explanatory, but your solution is only as good as the strategy and the team behind it. Failing to adequately account for edge cases, resourcing, stable deployment processes, or any number of other factors in the project life cycle can have a significant impact on the overall performance of the automated solution.

While it's been noted that automation can increase the stability and quality of your workflows, it should be remembered that you get out what you put into it and poorly designed automation can cascade issues much more dramatically than a manual process.

Now that we've taken a look at some of the general advantages, and disadvantages, of automation, let's take a look at some select core concepts so we can get a better grasp of what automation looks like exactly.

 

Concepts of automation

Many individual concepts within automation help define what it encompasses technically. In this section, let's focus on a few that are more applicable to common business scenarios or solutions within Software as a Service (SaaS).

To help visualize these concepts, please reference the following diagram:

Figure 1.3 – Visualization of the concepts of automation

Figure 1.3 – Visualization of the concepts of automation

Now that we have seen the visualization, let's take a deeper dive into exactly what these concepts mean.

Infrastructure

This is an important piece of the automation puzzle, and one not to be taken lightly. Thankfully, most SaaS will largely take care of this issue upfront. You begin provisioned with a powerful cloud solutions environment that can scale to your needs and contains robust APIs for interacting both internally and externally with the platform. Problem solved? Yes, but also no.

First, let's explore exactly what an API is. API is an acronym for Application Programming Interface, which is basically a middle software that allows two applications to talk to each other. APIs are essentially messengers for your two applications. I like to view it as if the API is a phone call between two friends. You can share information, receive information, make plans, cancel plans, and more via a phone call. Although you each have phones, voices, and so on, without the connection provided by the call, the API, you could not connect and communicate these messages without direct interaction. Now, back to the SaaS infrastructure.

While most SaaS platforms do resolve a lot of issues around provisioning and configuration, it may only be a piece in your larger workflow. Perhaps there is a business need for automating some communication with an external service at dynamic points in a customer life cycle? While some built-in tools can provide us with a way to track milestones in a customer journey, integrating custom services or solutions can require more complex solutions that require outside integrations.

Maybe you want to utilize your SaaS for individual functions within a larger automated workflow for your organization and not as a standalone product. Considering the road that your solutions run on is an important step in planning and designing a technical solution.

When selecting the environment that will house a given component of your solution, consider how well it integrates with the other platforms you've defined. Knowing how your systems are going to talk to each other is a key step of the planning phase and can drive the direction of your technical solution.

Triggers

Triggers are the events that flag an activity or process from some response or action by your automated solution. These can be initiated by both humans and machines and are the primary method by which your automated solution is compelled to complete some tasks.

A common form of triggers in most SaaS platforms is API entry points. Usually, when you call an API into the platform, it comes in with information that is used once the call is received (the trigger to take an action) to create a new action or process, such as returning data from the platform to the requestor.

Another example might be a form hosted on a website, and integrated with an external service or custom solution. The user triggers the event by submitting the form on the website, and an automated solution is called by that event to take some action (say, send an email confirmation).

These types of events can take many forms and differ in both type and the complexity of the action being triggered. For a webhook, like our form submission scenario above, some event is triggered automatically when an event has taken place in our environment.

Using something like an API, for instance, requires data to be requested and for a response to be generated based on the validity of that request. The main takeaway here is that we need to keep in mind that there is a wide range of possible trigger events, but the core concept remains consistent.

Data collection

Data collection often involves a form being completed, but it can also involve data being automatically extracted or received from a system. For most automated processes, the validity and robustness of your data store can define the scope or functionality of the solution.

While there are use cases where a method of data ingestion or collection is not needed, and the trigger itself is the only required source of action, most processes will require some form of data collection to generate an automated solution.

Planning how your data will be ingested and stored should be a priority when developing the flow of your automated solution. Ensuring your data store has a consistent structure and schema, and that the data you're storing is properly formatted and reliably populated, are both key to ensuring that you can retrieve it reliably when needed and that it will integrate well with your solution.

Important in this regard will be data validation, particularly when capturing or importing data from user-input or external services. Your solution will only be as good as the data you collect for it, so take care to make sure it's as clean and consistent as possible.

Information routing

Information routing involves moving data between people or systems where business rules and logic dictate where data needs to travel next. This is a common concept that can be found in solutions both internal and external to most SaaS platforms. When implementing a solution that utilizes complex data flows, containing multiple sources or destinations, understanding the routing necessary to seamlessly pull it together into a final source requires careful consideration of both your individual components and of how they depend and interrelate with one another. Sequencing, timing, and monitoring are especially critical and can be the difference between a successful or failed program.

For external solutions or those that involve multiple systems integrating within the same core initiative, it becomes even more important to understand the information routing occurring with a solution. In this scenario, you're accounting for the flows across various services that are subject to failures, timing inconsistencies, and misconfigured trigger events, among others.

Activity tracking

How can we define the success or failure of a program if we don't have a reliable way of tracking its performance against our defined goals? Tracking what happens from end to end in a process allows processes to be audited and measured in order to improve the solution or otherwise highlight points of failure that make it ill-suited for automation.

When integrating with external systems, this becomes even more critical, as there are more points for failure that must be accounted for and tracked reliably at the request level. Taking a proactive approach to logging, in addition to constructing your solution for ease in reporting and accountability, can help mitigate missed errors that propagate or obvious points for remediation and revision.

With these core concepts in hand, let's take a look at some common best practices to consider when building automated solutions.

 

Implementation best practices

As we've indicated previously, while automation can be a powerful multiplier for efficiency and productivity, there are no guarantees. Poor planning or implementation can lead to solutions that fail to meet the need at hand or, worse, negatively impact your initiatives as a whole. While many important aspects of the automation development life cycle can dictate the overall success of the project, by far the most important step is planning and strategy.

Moving forward without a clear idea on both your objectives, and detailed solutions to meet them, can lead to runaway scope, poorly designed systems, and unnecessary complexity. Let's take a look at a few best practices to keep in mind during this crucial step of the automation process.

Starting small

While it may be enticing to jump head-first into automating large and complex portions of your processes, the universally accepted best practice is to start small and target those items that will return the highest value for the lowest level of effort. Work with related teams to identify processes that are time-consuming or error-prone, particularly those that are both simple and repetitious.

Finding routine, manual processes that are low-risk and high-visibility ensures that you're both providing real value with your solution while not impacting your current initiatives in the event that something goes awry. Processes with low exception rates, that do not require human intervention, should be considered in this regard as well.

Ideally, you should consider those processes that are stable, well documented, and with well-defined risk and cost. Getting buy-in from internal teams is important as well, so looking for tasks where the savings from automation can be quantified and measured can drive support and adoption to get your solution into production.

Try and avoid the Rube Goldberg effect when an automated solution becomes so complex that no one but its creator has a hope of understanding its flow or intent. Processes that are atomic, reusable, and simple on their own are ideal.

Understanding the process

The term flying blind has a negative connotation for a reason. Approaching your planning and strategy without an adequate understanding of the systems, or processes, that you will be automating is a recipe for failure. Understanding how a given process is structured end to end, including how it operates both internally as well as with external systems, is crucial to delivering a successful solution on time. A failure to account for some factor during your planning stage can derail a project, or kill it completely, if your solution no longer becomes viable or runs over the projected costs.

Understand the process well and why each of its steps is performed in its current sequence. It is important to know why things are performed in their current state as they might not be suitable for automation, or only partially suitable. It can be counter-intuitive to automate four tasks when only two of them make sense and the other two could potentially even increase workload via automation.

Rather than fully automating in bulk, automating helpers as part of a process can be vastly more efficient than forcing a full process to be automated. Sometimes, checks and balances are required that just simply cannot be automated. Trying to force this into an automated process could greatly increase the risk or increase the level of effort on other teams to do the manual checking amid the automation, and so on.

Sticking to the objective

While automating data management, email deployment activities, or custom workflows and processes, you must always stick to the original objective outlined in your planning and strategy process. The introduction of a new business need or functionality, or new feature within the platform, can be alluring to attach to a project still in development, but it is important to stay focused on the initial needs and requirements outlined at the beginning.

By staying on track with your initial scope, you eliminate the possibilities of new additions either slowing down your implementation or derailing it altogether. Adding additional functionality in the middle of a project introduces unnecessary risks and has the potential to change the very objective of the solution you've previously outlined. So, while it might be tempting to turn your next data management process into a full-fledged machine learning solution, it's best to avoid this and to look for areas to enhance or branch for future projects.

These are just a few of the very important considerations and practices to take into account when getting started with the planning and strategy portion of the automation project life cycle. Obviously, there are other important practices to keep in mind during the development and testing phases of your project that have been touched on earlier in this chapter. One more that we should call out here is testing.

While you may think that your well-planned and developed project is immune to failure, you must identify likely exceptions and develop a testing strategy before you even begin your development. Having a solid testing plan and execution can reduce the error rate of your automation processes and can help drive more adoption and innovation across other processes in your organization.

Now, let's cover another best practice that is critical to the development and continued success of an automation project: documentation.

 

ABD – Always Be Documenting

You've written well-thought-out and concise code, so you don't really need to document it right? Wrong. We're all familiar with the experience of reviewing the code comprising a feature, where the nature of its structure, or even its intent, isn't immediately obvious. Worse, we may not know how it integrates with other systems or parts of the solution. By not documenting your code and configuration, and how it integrates with other parts of your solution, you've isolated the group of people familiar with it to a single person, or small team, while introducing the risk that someone may unwittingly impact your solution or services it relies on.

The primary reason that documentation is ignored is because of time, and conflicting priorities. Development doesn't occur in a vacuum, and it's not often that we have the time to stop everything and focus on documentation for our solutions. Apart from designing and development, we also have to consider unit testing, user acceptance criteria and quality assurance, and code reviews (among others).

Documentation is easily pushed to the side for other priorities, and not considered essential. In reality, it can be one of the most important factors for the final, and continued, success of a solution.

Regardless of the task you are automating, it is very likely that you or your team will have to revisit the solution at some point in the future. The purpose of certain blocks of code, exceptions that need to be considered, or even the configuration itself might have faded with time in the minds of the author and those new to the project as a whole may be completely lost. By not documenting your process thoroughly, you incur additional costs in time and effort when revisiting your solution requires additional time to unravel its meaning or purpose. Worse still is the fact that you add additional risk by missing a key component that, while common knowledge during your development phase, has been forgotten.

As developers, when approached with a new system or project, our first inclination is to likely seek out and review the documentation. Next time someone wants to understand your solution, you can simply point them to your documentation. It saves time and effort for you and gives them a helpful reference so that they can self-learn without being dependent on your time and availability.

In addition to this, documentation can make you both a better developer and team member. When working on an automated solution, it can be very easy to get tunnel-vision with a specific configuration or block of code, and how that holistically fits in with the overall structure of the project may be lost. The process of creating documentation during development ensures that you're always keeping the purpose of your project in focus, and it shapes the way that you create the individual components of your solution. There is also an easy reference for yourself, or your colleagues, that can aid in collaboration among team members and increase both the stability and quality of your solution.

Documentation best practices

Now that we understand some of the advantages of documentation, let's take a look at some best practices that will make it more useful to those reading it.

First, understand who the audience is for your documentation. Will it be other developers, or are you providing supplementary documentation for marketing or business teams? Including detailed code blocks and descriptions of their functionality may be critical for developers, but it's sure to drive away non-technical resources on your team. Structure your documentation to match the expectations of its intended audience in order for it to be both readable and effective.

Secondly, create a short, but descriptive, summary of your solution that explains the main purpose and intent of the project as a whole. This will help readers derive the purpose of the solution that you've automated as well as its relevance to their work or other business processes. Also, be sure to provide a description of the main components of your solution, noting any dependencies that may exist within your project. If your solution relies on APIs or third-party libraries, be sure to include their versions inside of your documentation as well.

Be generous with your coding examples when writing documentation for developers. Having a detailed explanation of what a given block is meant to accomplish, and how to both use and test its functionality, can save everyone time and effort when reviewing individual components in your solution. This will also make your code more readable as its intent will be clearly stated, and your solutions will rely less on inline-commenting or naming conventions to express their intent.

In summary, while it can be seen as a distraction or non-critical for a solution, documentation plays a key role in both the development and sustainability of your solution going forward. By empowering yourself and your team with a clear, and detailed, reference, you're incurring future savings of time and effort and ensuring that your solutions are more stable and of higher quality.

 

Summary

We have now reached the end of our first chapter! This was a lot of fun so far, and we hope it was the same for you. You should now have a solid understanding of not only what exactly automation and the theory of automation is, but also the general concepts associated with these. After acquiring this knowledge, you should now have a general idea of the opportunities and pitfalls of automation and best practices for implementing it. After that, we wanted to emphasize the high importance of documentation on automation and the associated best practices.

With these new skills and knowledge gains, we are ready to move forward to the next chapter, where we will begin our journey into exploring Salesforce Marketing Cloud and the automation tools available inside it.

About the Authors
  • Greg Gifford

    Greg Gifford, also known as Gortonington inside the Salesforce Marketing Cloud community, is a Salesforce MVP, Salesforce Marketing Champion, Trailblazer Community Group Leader, and a subject matter expert on the platform. As founder and managing director of HowToSFMC, Greg has made a large investment in the community and has striven to create a nurturing and learning-focused environment. Greg is also the owner and author of a blog, gortonington, where he posts interesting things he learns about Marketing Cloud or any other helpful tips or advice he can share. Greg is also very active on Salesforce Stack Exchange and is currently the top Marketing Cloud contributor of all time there under his alias, Gortonington. Greg is currently employed at Merkle as the director of SFMC engineering.

    Browse publications by this author
  • Jason Hanshaw

    Jason Hanshaw is a Salesforce Marketing Cloud engineer with extensive experience in building solutions for the platform. A former web developer, h

    Browse publications by this author
Automating Salesforce Marketing Cloud
Unlock this book and the full library FREE for 7 days
Start now