Matthias Mueller - Campaign Monitor | Marketing Meetup | RStudio
videoimage: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
Awesome, thank you. Yeah, it's really cool to see all these chat messages from people all over, so very neat to have a diverse group join in today. Yeah, I guess the caveat here is if you do message Rachel, just don't be surprised if you get roped into doing one of these.
So, but no, I'm super happy to talk about some of the stuff that I do. And I guess without further ado, like you said, let me just share my screen here for this presentation.
One thing I'd say is that I probably won't be able to see the chat, so I might not be able to answer to anything that comes up inside of there as we go, but hopefully we'll have some time at the end to talk through, you know, whatever's going on, or whatever questions.
I can read them out to you too, so you don't have to worry about. Oh, great. And Mike will share the Slido link in the chat window. So then people can upvote questions too. Oh, incredible. Awesome. Well, I guess let me just get started. Can everyone see this?
Introduction
Great. I see some nodding, so I'll take that as a good sign. Great. So I guess let me just really quickly introduce myself. So my name is Matthias. I'm based in Nashville. I've been in Nashville for around about seven years now, but I'm actually originally from Germany. So I kind of took a very odd detour into the United States.
On a personal level, I've been married for just 10 years now. I had my 10-year anniversary earlier this year, and then I have two kids. One of them is actually turning six next week, so it's a big one in this household currently, and then I have a two-year-old. His name is Adam.
On a professional level, as Rachel said, I direct the marketing analytics team at Campaign Monitor, and also Moonlight as like a teacher at the Nashville Software School.
There's Adam. Feel free to connect. I'm happy to talk about this presentation or anything else that revolves around data science. I guess it would make sense for me to talk about Campaign Monitor just for one hot second here. So Campaign Monitor is a family of friends with Campaign Monitor or CM Group sort of being the parent, and then we have several brands and products that fold into that. So there is actually the namesake company, Campaign Monitor, but we also own brands like Emma, Delivera, Cellogen, Sailthrough, and a slew of others, so essentially all marketing technology companies, and we are sort of a bit of a conglomerate in offering different solutions to different types of marketers.
So as a group, where we'd like to call us a leading marketing company, we have about 7,000 global customers, and again, those could range from a very small business that might just need a simple email marketing newsletter type service.
All of that fun stuff. Just that $180 billion there refers to the amount of emails that we've sent just last year, so that's the scale that we're operating at on behalf of our customers every year. Campaign Monitor is, we're roughly 1,000 employees at this time, and 90 of those are inside of the marketing group, or 90-some of them are in the marketing group, and then my team specifically is actually fully embedded into that marketing function.
My team serves as an in-house agency or in-house analytics agency. Now, other companies might refer to this as the center of excellence, so we're a function that serves essentially stakeholders inside of marketing, which is a lot of fun because it gives us different analytical requests all the time, so one day we could be working on optimizing something like the marketing mix, and another day we could build a lifetime value or work on multi-touch attribution problem, customer journey mapping, and so it's really neat because it's a diverse set of problems that we work against on any given day.
In order to do all this, my team, like Rachel said, is consistent of a slew of different functions, so there's research, insights, engineering, and data science function, so I have mostly four groups. The research team essentially is there to produce and procure data that's not currently available to us and try to figure out how we can make that data available. Insights, it's really kind of more traditional analysts, so they're really highly integrated into the marketing function that they work with, translating data into insights for that person that might not have a technical background. Engineering, I mean, I guess given the types of people on this call, it seems like it's fairly self-explanatory as well as data science here.
Between analytics and engineering or traditional data engineering, and then last but not least, data science, so this is actually where a lot of these more advanced projects happen, so anything that deals with things like forecasting, MMMs, MTAs, and so on would live in that function.
The problem: data overabundance and dashboard fatigue
So that's a quick overview over my group, and at first when Rachel and I were talking about what I should be talking about, I wanted to actually speak on, like, you know, hey, let me just pick out a random project here and I'll talk about, like, a model that we built or something, but I actually decided against that in the end and wanted to talk about something more foundational, so given the unique setup that we have being sort of like an in-house analytics agency to the rest of the marketing team, I really wanted to talk about adoption and making sure that things that we produce on the data end, you know, how do we actually get people to utilize our stuff?
I also hopefully find that a little bit more translatable to, like, the greater group here that might not all be in marketing, so I think for data science specifically, you can do absolutely incredible work, but ultimately it comes down to if no one's using that work, then as, you know, it doesn't really matter that you did all of it, so in our setup, that actually can be a specific challenge since we're working with so many marketers of different disciplines, and most of them actually don't have, like, a quant background, you know, like we could be working with copywriters from one team.
absolutely incredible work, but ultimately it comes down to if no one's using that work, then as, you know, it doesn't really matter that you did all of it.
So really today I decided to just talk about how we're solving that and how we're solving that specifically at Campaign Monitor inside of the marketing project, so in short, if I titled this, like, how do we actually serve insights to the team using automation or code, so to say.
So to talk about this a bit more in terms of what the actual problem is, so I already touched on that problem there a bit, but really level setting, like, who we are, so we're a global marketing technology company, we have an incredible amount of data available, so there's sales data, there's website data, behavioral data, like, I could keep going, and that would probably be the entire 60 minutes of today, but ultimately we have this treasure trove of data, and the first instinct as a data scientist is that this is actually a really fantastic thing, right, I have a lot of things I can analyze, but we actually noticed that specifically in our use case, in our specific setup, that overabundance of data also comes with a lot of challenges.
So first, and this is a really big one, so dashboard fatigue is a real thing, so we, as we scale and as we grow, and when I first started at Campaign Monitor roughly three years ago, we were about the third of the size than we are now, it's becoming increasingly hard to just build something in BI, push out a dashboard, and have people utilize that business intelligence simply for the fact that, you know, it's not a very scalable process, because you ultimately cannot expect people to spend their entire day just looking at dashboards, it's just there's cognitive overload that happens there.
Secondly, like, BI, I think, can be really hard to digest, especially for non-technical people, so what I mean by that is, you know, if I, um, let's say I built a visualization that's a bar chart of revenue, for example, you know, like, everyone can hopefully understand what, you know, like, sort of, like, look at this and understand trends and see if it goes up and down, but then lots of times that actually misses the context of what's going on, so kind of giving people BI without, um, sort of guiding them through what this actually means, or what's going on in the deeper level, and sometimes can be really, can be a problem for us.
And then last but not least, I mentioned this BI there a few times, so we have a Looker instance, so we do utilize that pretty extensively, so we have, you might call it sophisticated business intelligence available to us, but that really requires a stakeholder to be self-driven. In many instances, it requires training.
There we go. Good, uh, good segue. Um, cool. Well, I guess, uh, in anything, like, you know, I could keep going. I'm sure there are actually more problems that we had with the, with the prior setup, um, uh, but I guess for now, let's just leave it at this. So, ultimately, if we want to democratize data across the marketing organization, like, we really needed to find a way to serve insights to people directly, uh, as well as, like, in an easily digestible way, um, and at Campaign Monitor, uh, we're actually using a Slack bot for that.
Introducing the Slack bot
Um, so, uh, I guess if I could, you know, ask for a show of hands, like, again, I can't see anyone here, so, um, you know, I'm just gonna pretend, uh, show of hands, um, how many of all of you are using Slack? Uh, I'd wager to say that it's probably a good proportion.
So, ultimately, um, if you're unfamiliar with Slack, uh, it's essentially a business communication platform. Uh, think of it, like, it's like a better, better chat, uh, environment where you can have a direct message, uh, with all of your, uh, colleagues, but you can also have, uh, grouped together team channels, um, where, um, you know, you can collaborate with your coworkers. Uh, at the end, um, essentially, Slack has all but replaced email internally, so I only get, like, a few emails, uh, every day. In fact, um, I actually enjoy that a lot because the only people that really email me, uh, are outside vendors, so I can, uh, you know, I can decide whether or not I want to engage on any given day with, uh, with outside vendors because everything internally usually happens inside of Slack.
And, uh, um, for us, that's really a huge opportunity, right? Like, because we know, uh, communication, collaboration happens in this, like, centralized location, um, and we can, we can use that to our benefit, uh, which is what we're doing with this Slack bot.
Let's talk about Slack bots for a moment. Um, uh, for those of you that are not familiar with the concept of a bot, um, so in layman's terms, um, a bot is like any other user, um, that you could have on a platform, but really it's a robot, um, so it's a non-human, um, a user in this case, and that, that, uh, bot can execute tasks, uh, as their program to do. Um, so in this, like, really, uh, silly example here, we could code a bot that interactively listens to anyone asking what time it is, and it would just respond with, like, today is this, it's that time, uh, which, you know, even more preposterously, like, Slack actually puts the time message there.
Number one, uh, an interactive bot, like the one I just described, um, where you could have, as the name suggests, interaction with that bot. Uh, so, uh, you know, there's things like slash commands in, um, in Slack, um, but also, like, listening as well. Um, and then there's non-interactive bots, um, which essentially just, uh, post information into a specific channel or group. Um, for this purpose here, um, I'm actually going to focus on the non-interactive portion, um, you know, uh, because I think that would break the, um, break the scope of this presentation.
Um, but, uh, it's also, uh, useful because at Campaign Monitor, we actually, um, use this non-interactive feature quite a lot, um, to, uh, give people information that they want, uh, or, uh, that, um, that we deem important at that given time. Uh, so at Campaign Monitor, we actually created this Slack bot called Mr. Predicto. Um, this is kind of a silly joke, uh, silly inside joke. So at one point, we were, um, building marketing forecast, and then someone jokingly said, like, can't we just have, like, an additional predictor variable that we put in there, um, that's just based off one of those, like, kids' fortune-telling toys where you just bop the thing, and it's just, that's like, yes or no. Um, you know, we didn't do it, but, like, that's ultimately how this Mr. Predicto thing was born because apparently someone on Amazon sells this, uh, this thing called Mr. Predicto, and it's essentially like a kids' toy fortune-telling ball.
Um, but we, we did this, um, that is to say that it's fully customizable. You can do essentially whatever you want with it. Um, you know, all you have to do is, um, uh, use the Slack API documentation. It's really well documented, um, and it's actually really, um, really easy to, um, um, use, uh, online graphical user interface that you can use there.
Webhooks and pushing data into Slack
Um, so once you authenticate this thing with your Slack credential and you add it to your, um, to your Slack organization, um, you can then move forward, um, with trying to understand or trying to see how you can actually push data into, uh, into Slack. So, um, non-interactively, the easiest way to do that is using webhooks. Um, so, uh, that's a bit technical if you don't know what webhooks are. So, um, let me just go into that for a moment. So the easiest way to push data into Slack with, through a bot is using incoming webhooks. Um, so webhooks are, um, you know, and I guess in simplified way, um, a way to push data into an API.
Um, so in the most basic form, uh, really in, in order to push data into this webhook, um, uh, you can in terminal, you could curl, uh, an example, and essentially you have a webhook URL that you, that Slack would give you for each specified channel. So if you in Slack and you, uh, um, uh, you know, you can select the specific channel that your bot should be, should be part of, and then in the backend of Slack API, you can look up what the webhook URL is for this specific channel. Uh, so in this case, you know, it returns you this, um, this URL, which is what we call a webhook URL. Um, and then the other thing that this, um, this specific bot requires is, uh, just the payload. Um, and in this case, a JSON object notated, uh, payload, um, where, you know, simplistically, essentially you can pass in a text that just says, hello world, you run that. And at that point, the bot would actually post hello world inside of this channel that's connected to this specific webhook.
Um, now full disclosure here, um, I'm not like a Unix wizard. So to me, uh, that's sort of like the, the extent of what I would do in the terminal because I'm much more comfortable in R.
So, um, the, um, uh, HTTR package, um, has, uh, that is essentially a post request to the API. So while the code here looks a little bit different, um, I'm hoping that it still looks a little bit familiar if you think about like what I just showed you on the previous slide. Um, so, um, it's still going to have a, uh, webhook URL, right? You, you still, uh, you still post that same, or you still, uh, utilize the same URL, um, where, uh, um, you know, you would just paste in that, um, that URL that you, that you've given. Um, and it still requires a JSON payload. It just kind of, uh, is a bit different, uh, in terms of formatting. So in this case, it's wrapped into like a paste function, um, that is essentially just, uh, ends up concatenating the whole thing.
Um, and the reason why it's written this way, um, is that ultimately, uh, obviously hello world alone, isn't going to cut it for me, but I also want to paste in, you know, maybe, uh, the output of an available variable that I'm using somewhere else inside of R. So, uh, functionally though, uh, this code here, uh, does exactly the same thing, uh, then what you would, um, then what the previous slide did. So if I actually execute this, so if I run this R markdown chunk, um, it would run it, um, and you would actually get a bit more of a response back. So it just kind of summarizes that response. Um, this is, um, HTTP, uh, response, uh, code. You can look here, the status of 200 in this case, um, means that it went through fine. So 200 is like the response code for you. Yes, this, this works.
Um, for those of you that might be in marketing, uh, a bit more, you might be familiar with like three or one, uh, uh, statuses or three or two statuses, uh, which have to do with redirects and all of those, but, uh, essentially, uh, this status code here is really useful, um, for you to understand if this didn't work. Um, you know, the status code is usually a really good way of telling, um, why it didn't work. Most likely for me, it's 400, which means I formatted something wrong. Um, but once this executes, what happens on the Slack side is literally it would do the same thing and post hello world.
Building richer messages with the block kit builder
Um, so obviously hello world, uh, kind of neat little example, but it doesn't really help anyone, uh, to just kind of post in random text. Um, so obviously we want to extend that past this like hello world, um, uh, example, because it's a bit uneventful. Um, so if we want to do more stuff, um, like there's actually a really great blueprint inside of the Slack, um, uh, API documentation, um, which is this Slack, uh, block kit builder or block kit builder, um, where, uh, there's essentially a graphical user interface that allows you to, um, build your message, uh, as you, uh, you know, as you would like to build it. And on the right side here, it actually tells you, uh, the blocks of the payload that you can use to build this message. So you could, uh, you know, and there, there's a ton of different things available. So you can use anything from like buttons to images to, um, links, Slack markdown notation.
And it was just kind of give you an example of, um, okay. So if you build an example here on the right side, it would actually tell you, uh, this specific payload or the specific JSON object that you'll want to build inside of R, uh, to then push into this framework. So in, in, in essence, actually becomes really easy to build more sophisticated messages. Um, and, um, to me, um, that kind of really means that there's virtually like endless possibilities, right?
So, um, once you have this like initials done, like your environment, um, there is so many things that you can do. Um, I can pay monitor, uh, figured I'd run through a few things that we've actually done here internally. Um, so we've built like internal notification systems, uh, where we push, uh, insights into like our own team channel. So marketing analytics for this as a, as a locked, uh, internal channel of my team, uh, that highlights code breaks, it looks like anomalies and data. Um, it does, uh, a basic automated reporting for like some of the things that we're interested in.
Uh, we've built, uh, notification systems for other teams. So for example, um, we have a paid search forecasting and anomaly detection for that. So we track daily, you know, this might be a very marketing focused here, um, but like a cost per click. So how much are we paying for each click that we're buying on AdWords? Um, over time, like, is that deviating from, uh, what we, you know, paid the last bit on average, uh, over the last few weeks, like click volume impression. So essentially, um, we, we can do any, anything that we can like build a model against, uh, we can ultimately push into Slack.
And we have done that for like the performance marketing team, um, in many instances. And then as this actually, as we started doing this, like internally inside of marketing, um, it actually grew and grew, um, sort of the concept of no good deed goes unpunished. So, uh, we essentially now have organization wide notifications that we've built and put in place. Um, you know, where we might be notifying entire teams when certain reports are available, certain data has been refreshed. Um, you know, like monthly postmortems, we would write in like essentially an R or R markdown. Um, and once that's available in the end, it might shoot up a Slack with the link to it. Um, so people can then, uh, end up, or they can, they can use that, um, and get that information right where they are.
A real-world example: daily MQL anomaly detection
So in short, really anything that you can envision, you can code an R, um, has some way of being pushed into Slack. Um, it wouldn't be, uh, I guess it would be, uh, um, uh, not fair to actually not talk through a specific example. So this is one, uh, um, you know, that I'd like to talk about, which is actually something that's currently still in production. So we actually use this, uh, still, even though this example here, I just put this random number up, um, from December of last year, but this still runs every day.
Um, and this tracks, uh, uh, daily MQL volume. Uh, again, for those of you that might not be in marketing, um, MQL is a, uh, sort of a Salesforce, uh, uh, terminology for marketing qualified leads, which is a, uh, indication of how much, uh, how many, uh, opportunities, um, we're bringing in into the company, um, uh, that our sales team can hopefully, uh, um, uh, close for us. Um, and in this case, in this specific case, um, you know, like one thing that you could see here would be that like, hey, we're tracking, uh, you know, a non, we're tracking MQL volume over, you know, for, for yesterday. And we actually compare that against the same weekday of the five prior weeks. So in this case, um, this Wednesday number here, um, of like 19 MQLs would have, uh, compared, or this, this, uh, confidence interval that's calculated is essentially the prior five Wednesdays that it uses as input data and then models out where we feel like we would be. Um, so in this case, you know, obviously this 19 number is much higher than like the, even the top range of 11 that we expected here.
So, um, you know, that's, that's a way to like immediately notify specific teams of what's going on. Um, one thing that I'd love for you to pay close attention here, um, is that it actually just took seven minutes in this case. Um, so again, this is a true screenshot here. Uh, it took seven minutes for people to start talking about what was going on. Um, you know, in this case we changed them like a demo form there, uh, made it a bit shorter and that, that, um, seemed to have been the, the thing that was driving, uh, some incredible increases for us.
Um, one thing that I'd love for you to pay close attention here, um, is that it actually just took seven minutes in this case. Um, so again, this is a true screenshot here. Uh, it took seven minutes for people to start talking about what was going on.
Um, but, uh, uh, you know, that's, that's, that's a use case of how we're using, um, uh, in this case, anomaly detection, um, to really kind of quickly gauge performance and determine if any action needs to be taken in this case.
Um, so let's take a look under the hood here though. So if we have this message, um, you know, while it might look like a sort of complicated message to send, you know, you have text, your graphical elements, there's like this weird, uh, um, uh, sort of quote, uh, indent there, you know, there's different, uh, different formatting and all of this. Um, we can like fairly easy to deconstruct this. So at first, um, we, I guess to level set this, assume that there is a data frame somewhere, um, that essentially stores the anomalies that we detected. So I'm not going to go into like the actual model of how we, um, um, in this specific case, build out, um, or identify anomalies. Um, cause again, that would probably be outside of the scope of this presentation.
Um, so in, in, in that sense, um, if we deconstruct the message, it really kind of still, um, works in a, in a fairly simplistic way, right? So this message that, um, posted here has a title. So at the top here, uh, this blue part, uh, would be called message title. And we stored this into this object, um, uh, called message underscore title. And we just paste together, essentially concatenate this entire thing, um, to come out with like one long string of things that actually leverages in this case variables, um, to paste out this, um, this specific, um, uh, character string, right. Or vector.
Um, you can use, uh, if, if you're, um, if you feel like you want to, you can use a Slack, uh, um, markdown in it. So, uh, it's actually fairly similar to like, uh, how you would, um, um, how you would write markdown inside of R. So for example, um, this asterisk here, um, and then it ends, um, the asterisk closes here, which essentially between two asterisks is it bolds text. So as you can see, it says daily anomaly detection workflow, MQL volume four, and then bold it, and then look at, uh, W day, uh, weekday is a function from lubridate. So it just looks at, uh, it wants me to paste out like the weekday, uh, for yesterday, um, and then add the actual date and then end the bolding part.
Moving on, the second part, um, is, and I guess I have to first apologize to everyone, uh, that's a true R person here, um, for the use of this for loop. Uh, so there's probably a better way to write this with an apply function, but I guess bear with me for, um, for the time being. Um, but basically, um, uh, what this does is it's writing this loop, uh, that goes through this, uh, previously referenced, uh, data frame called anomalies that essentially just is output of our, um, uh, of, of that, that specific model and has severed columns to like tell us like, okay, what is the, um, what's the predicted value? What's the confidence interval? Like, um, what's the actual value? So, um, essentially it just kind of looks at that and goes through each of those rows individually.
And, um, again, I'm making use of this, uh, Slack, um, uh, Slack markdown. And so essentially trying to figure out like, is this a good anomaly where we have more or less? And then based on that, it uses this colon triangle up green transparent colon, which is essentially a way to write an emoji inside of Slack, um, which the triangle up green transparent is what you see here. And then trialing down red transparent is the one that you see here. And then it's just basically keeps concatenating this thing out, uh, until it gets to like that entire, um, the end of the, um, the row here. And then it just kind of starts at the top and it runs through every single anomaly that we've detected for the prior day.
Um, the footer, um, is pretty simple, but we actually found that this was, uh, uh, very important to add. Um, so, uh, many times we actually will add the, um, the link to the business intelligence dashboard inside of here. So we, um, we, for everything that we post into Slack, uh, we try to give people a, um, an option to actually, um, uh, dig, dig in further if they'd like. So we, we generally hit, uh, um, link the source of truth for that data. Um, like I said, in many cases, this will be an BI dashboard. Um, in this specific case, uh, it goes directly to our Slack, um, uh, oh, sorry, uh, Salesforce instance there, uh, which has that, um, MQL volume, uh, that we're looking at in this case.
So, um, really there's two purposes. So for a stakeholder, they can access the data. Um, and then internally for my team, uh, it's useful to actually, as a starting point to look into like these types of anomalies. So usually what would happen is that if, if something gets surfaced to us, um, you know, having the specific report at the bottom, uh, is helpful because if there's something that we want to look into, we can just click on it and you're already kind of in the process of, um, you know, uh, and analysis for it.
Um, again, another, um, another way of how we're trying to like, um, use this Slack bot to kind of spur, uh, democratization of data and like really kind of make people familiar with data and if they want to dig deeper into it now, now that we've filled those three, um, parts out. So we have a vector with message title, we have a vector with message body, and then one with footer, um, like the actual post request from the HTTR package is pretty simple, right? So if I go into this one, um, uh, basically all we have to do is, uh, write, um, write it in the, uh, the syntax that, you know, we know from that, um, um, from that Slack kit builder.
Caveat here, if you're actually doing this and this is all familiar to you and you have done everything this before, um, this attachment is actually, um, this specific code here, um, is actually not the newest way of writing this anymore. It's a bit different now. Um, but you know, in times of, uh, when we wrote this, this specific bot, um, you essentially wanted to use this attachments function. Um, they, uh, it's not completely deprecated, um, but like, uh, it's, it's sort of a legacy way of doing it. So there's now also different ways of using blocks.
But, uh, so basically, um, uh, like I said, uh, we still, uh, have the same, uh, title, message footer and message body, which is just vectorized, uh, um, variables that I'm pushing, uh, into here, into like this, in this case, uh, turns out that the message title, so that portion of the top, um, is actually, uh, um, a thing called pretext, uh, footer, footer, and then the message body is the actual text portion. And then I'm also passing in this color, um, color indicator, which is the color of the, um, sort of the quotation indent. So you can change that as well. Um, again, that is to say that there is a lot of ways that you can customize this. So you could, one thing that we've done, for example, is anytime the code breaks, um, we actually highlight that red, um, you know, where for this case, this F2, F2, F2, a hex color is just a gray bar.
Um, so if I actually go in and I run this code again, uh, I get the same thing. So like the status 200 here, it looks good. Uh, post me that response, the HTTP response thing there. Um, and, um, it turns out that, uh, it would post it just like that in Slack.
Attaching ggplot visualizations
Um, cool. Um, so that's a, that's a text-based, um, example, right? Where we still all, um, uh, we're using basically exclusively text in order to, um, uh, get information across. Um, but while I'm not going to go like sort of like deep into the code for the next example, like I did want to put a slide on here, uh, to show you that it is possible to do different things there. So in this case, uh, you can put a ggplot visualization, for example, as an attachment, uh, into a Slack bot message, uh, where in this case, um, you know, this is one where, uh, we're tracking the daily, um, the daily attainment of sales pipeline, um, with, and then we have actually have some, uh, year over year data. So you can see, uh, um, you know, pipeline year over year, and then we're pasting out a target based on a specific, uh, like, uh, assumption. Uh, so in this case, the target, we have a target that we're actually pasting based off of where, how we are pasting last year. Um, so basically we can have a completely custom visualization built inside of ggplot and push that into Slack, um, which is, uh, something that I would wager to say is probably harder to do in, uh, in the BI tool, um, since we can leverage some of the models that we're building already anyway.
Um, little disclaimer here at the bottom. So, um, when you push images into Slack, it actually requires a bit more, um, you know, um, variables to be passed into this, um, process. So there's a specific bot token you'll have to pass. Um, but, um, that is to say it's not that hard to figure out and, uh, um, it's all, uh, it's all possible, um, you know, for, uh, for someone with some more skills.
Automating with RStudio Connect
Um, so those are some examples. Um, now basically we're now at the spot where, um, you know, if you think back of what I did and obviously this is a presentation, so I kind of faked it away, but, um, really we haven't actually automated or productionized anything. So at this point I have an R script that, you know, essentially I have to run every time and then it does something for me. Um, so internally, um, we actually use this process, um, with RStudio Connect. So we have, uh, um, most of our data sits inside of a Redshift instance. Um, I say most, um, it's really just most, it could be anything we could hook directly into, uh, into Salesforce instances. There's some proprietary systems that we have as we, uh, grow like organically and inorganically. So we, uh, tend to acquire other companies as well. They might have a different data stack, so it could be different.
But basically, uh, for, uh, as a standardized process, we have data sitting somewhere. We'll write some SQL, put that data into R or Python, um, and then we use RStudio Connect to kind of schedule that, um, that process of running that R script, um, on whatever cadence we want it to run.
Note that if you don't have RStudio Connect, um, you know, we actually previously used, we've previously done this, um, just with the good old Chrome tabs. Uh, so if you're, uh, you know, if you have like a Unix box or anything, uh, you, and you, you know, you can show into that and, um, run the R script on the schedule, that is the same process. Um, but for us, uh, from the ease of use perspective, uh, and many other reasons, uh, you know, we decided that RStudio Connect was a good, uh, sort of intermediary, uh, that would, um, take care of all of the, uh, code execution for us, uh, on a, um, on a recurring basis.
So what does this actually look like? So in this case, and this is again, that daily lead checker there. Um, so if you write your R code inside of an R markdown file, uh, then you can just deploy that into RStudio Connect, and then essentially schedule that, um, to execute whenever you want it to execute. So you could run this every five minutes if you want to do, um, the daily lead checker here actually just runs every day for us, um, you know, at 12:15. The reason why that is, is because, um, that our, some of the ETL processes for us, uh, end at 10 a.m., uh, Pacific time. So that's, in my case, I'm, uh, I'm in Nashville, so this would be like 12, you know, noon. So when we run this, I know all the ETL processes have refreshed. I know I have the newest data in the data warehouse, um, and, uh, um, essentially that's when my, um, daily lead checker for the prior day, uh, executes, and it does so every week, every weekday, um, and it hasn't failed yet. So I, uh, I'm pretty happy with that process.
Wrapping up
Um, so, um, to wrap this up, um, you know, it really, like this whole thing really is a win-win situation for us. So for the organization, um, you know, in terms of democratizing data, um, this was really fantastic because, um, it really helped, like, both technical and non-technical marketers, um, really get the data that they needed, um, to make business savvy decisions. Um, we've had, um, numerous requests to build additional, um, uh, additional notifications out, um, very, very specified to individual people. Um, so, uh, you know, we could send, um, you know, a custom report to just one individual if we wanted to, if they were interested in one very specific data point.
Um, and then, uh, for the analytics team, uh, you know, um, while we are growing and, you know, uh, um, where, uh, we have been growing and I think we're going to hire some additional, uh, folks, uh, over the next couple months. Um, we're still a lean organization and, you know, we support different, many, many different stakeholders. Um, so bandwidth is an issue for us where, uh, we really have to do well in terms of prioritizing which projects we, uh, uh, we work on with that, uh, sort of meet that, um, impact versus, uh, effort, uh, kind of, uh, calculation.
Um, but before we implanted some of, implemented some of these processes, um, there was a lot of tech debt that we had to do, you know, a lot of redundant reporting tasks, um, and, uh, the light. So all of that is, uh, we're able to automate away. And with that time saved, um, you know, we can essentially reallocate that to things that we actually feel like are impactful. Um, so it's do more shit. That's cool. Right. That's what we all want to do.
Um, so, uh, that's the end. Um, that's where I am. Uh, so I hope this was useful or helpful to some people. Um, and I'd love to hear some questions if there are any.
Thank you so much, Mattias. That was awesome. And it's actually making me realize the technology behind some of the Slack bots that we use here at RStudio too. Um, there's a few questions in Slido that I'll go over too. And then if anyone wants to upload other questions or put other questions in there, if there's anything we don't get to today, I'll be sure to send them over to Mattias as well, if that's okay. Yeah, absolutely.
