What is Segment? How to Implement and Use It.

What is Segment? How to Implement and Use It.

Danny Lambert:

Hello everyone, this is Danny Lambert. Today I’m going to be going over a really cool tool. If you haven’t heard of it, you really should check it out. It’s called Segment or Segment.io. Essentially what the tool allows you to do is take all of the web traffic and events from your mobile application, your website, cloud apps like your CRM system or your marketing automation tool or your web application, and then easily pipe all that information through one API to all of your different destinations.

Danny Lambert:

So as you can imagine, you might want your unique users tracked in your marketing automation tool in Google Analytics, in Salesforce, in Mixpanel and a variety of places. A lot of times it depends on marketers and going to the development team and saying, hey, I need this information and be able to place these ad placements or to be able to see what customer tickets were resolved and a variety of other use cases.

Danny Lambert:

That’s really where Segment comes into play. Essentially a customer data management platform that allows you to just use their API to pipe your information from all of your various platforms, wherever you need it to go. So as you can see, their marketing is super clean. Their website essentially goes through the process of explaining how you can pass service side, client side, mobile, everything to all of your various tools and does a very good job of explaining all of that.

Danny Lambert:

They have all the different destinations. So imagine whoever you’re collecting the data from, your web application or your website, wherever, and then the destination being wherever you’re piping that through. So the source being the source of where the event happened and the destination being where you want that to go.

Danny Lambert:

So all that is laid out pretty well on their website as well as their pricing was really cool. About their pricing is they allow you up to 1,000 monthly track users for free and up to a certain amount of events, which is really cool that it allows you to get your feet wet, like I’ll show you here.

Danny Lambert:

It starts to get used to before you have to commit to a paid plan. As well some other cool product features they have coming out, which are personas, which are going to be super powerful for them in terms of identifying key personas within your buying cycles based on different activities that you track. All that’s going to be coming up really shortly and it’s super cool.

Danny Lambert:

So before we go too far into that, let’s just go ahead and jump right in. So right now once you log in and create an account, this is what you’ll see minus this information right here. All the process consists of is creating the source where your data is created, where you need that information to go and then connecting those two together and figuring out what you want to track.

Danny Lambert:

So today we’ll be tracking my website plushrepublic.com. So you can see that I’ve already created the source, which is that site. But I’ll go ahead and do it again really quick. So you’d come in here, you’d click add source, you connect it with some mobile applications, service side, whatever, the source of the information that you want may be, and you’ll go ahead and select that.

Danny Lambert:

So I’d click JavaScript, it’ll give me some code that I’ll put on my site. So I’ll click connect. I’ll name that container. So if it was like Plush Republic website and then I would put in the URL. Once you hit add source, it will then give you the JavaScript code that you need to put on your site. The way that I implemented it, was via Google Tag Manager. I’ve seen videos from them that suggest that you should put it into your hard code and not use a tag manager for implementing their actual script tag.

Danny Lambert:

But it’s working for me just fine. If you have a little bit more of a complex setup, you may just want to ship it to your source code and via GTM. But you can see that once I come in here, how I set that up. So I’m just within my Google tag manager account, go to my tags, Segment, I grabbed theirs, I do it on all page views.

Danny Lambert:

I just dropped it in. Publish it to my tag manager. Put it in preview mode. Make sure everything worked fine, and that’s all set up. So once you have that finished, that’s where you’d grabbed that code from and you drop it in there. So after that you’re all set up. At that point, you can see I’m actually in as a user, so I’ll open up a incognito window.

Danny Lambert:

But you can see just with that amount of information, just by putting the tag on your site, you’ll already get page tracking information. Very similar to what GA would do. You can even pipe this information into there. But you’ll notice there’s this anonymous visitor, when I look at the raw data on my homepage.

Danny Lambert:

So if I click through to view services, this should then, almost in real time alert me that that same anonymous user is now on the services page. So its tracking all of that. A really good start. So eventually from here you’ll want to start to track more information in terms of, if I register as a user and then if I register as a user, if I add something to the cart, I use a coupon code.

Danny Lambert:

All the various events and lack of events like page abandonment, whatever or cart abandonment that you want to track, can be pushed through Segment to every other analytics tool that you can think of for the most part. They have over 200 integrations. So let’s quickly walk through that.

Danny Lambert:

So here’s my live feed. Just so you know, here’s the schema of all the different pages, the amount that they’ve been happening. Once I start tracking events, identifying users. It’ll show me trends over time about how many leads are being tracked in that day, all that good information. So if you’re seeing lapses in abandonment, check out all the information you’ll be able to see in a nice graphical interface here.

Danny Lambert:

Or you can go into the analytics tool after that, that is piping the data into and run your reports there. Obviously it’s up to you. So at this point I want to be able to capture a lead. So let’s go back to that debugger real quick and see what happens if I convert. Go to contact us and you’ll do lar@test.com and let’s say lar, not even sure what that is, but we’ll run that.

Danny Lambert:

At this point it should take that anonymous idea that I’ve created up to this point and then once I submit this form, create me as an identified user and then append all of that previous tracking information to my newly found user as well as everything that happens after the fact to that same user ID.

Danny Lambert:

So let’s go ahead and click send. My form has been submitted and boom, there you go. This is it. Tracking that information. So you have to do a track call, which I’ll show you the documentation and identify and then track. So now it has seen that this anonymous user is now me, lar@test.com and appended all that information.

Danny Lambert:

So if I start to move pages from here and I moved back to services, you’ll be able to see that when it gets that new page call. Now it knows at that belongs to lar@test.com. So this is great. You’re going to be able to take all the pre-sales funnel, post-sales funnel information, collect all of that, all the different events and send it through one API to all of your tools. It really is a game changer.

Danny Lambert:

Your question that you probably have now is, well how easy is it to set this up? Because I can imagine I’d have to talk to a developer to set up all these different events and Segment just makes it super easy. That’s not the case. So we’ll go ahead and show you how I set this up. All I had to do was create an event.

Danny Lambert:

So in their documentation, which is very, very strong, that’s in their spec, it shows you how to identify user, when to identify them. So if they’re logging in from multiple devices, what are best practices around identifying the users. How to pass it information, which is what we just did, identified myself.

Danny Lambert:

What the different track calls are. So if I want to track events after the fact, so a button click or any of that information. You can track those specific events and then associate them with that user. Then the different page views, if you have priority pages. Like viewed pricing, you want to push that, all of that is super simple to set up.

Danny Lambert:

But don’t take my word for it. Let’s just show you. At this point, I’ll go back to the form that I had just submitted and you’ll notice this is all the code that I needed to make that lead populate. So all this is doing is a brief jquery right here for the contact form with the ID contact form, which is this.

Danny Lambert:

Then on submit, it’s just saving the input name, your email, which is this one here is the value to the variable email and then it’s pushing that email into analytics that identify, which is the nomenclature that Segment uses. So it’s pushing that as an event with the property email sets of the fields here and it’s tracking that as a new lead.

Danny Lambert:

So identifying an email and then tracking that as a new lead event in the system and it’s as easy as that. So now you might be wondering, well how does that information get into my different market automation analytics here and wherever else you plan to go? It’s as simple as the destination set up.

Danny Lambert:

So all you’d have to do is click add destination here and search for one of the hundreds of tools that they have. Mixpanel for analytics. You have ad words, Facebook Pixel, all of this. Hotjar for optimization, VWO, all the tools that are probably already in your stack are here. The setup is really, really simple.

Danny Lambert:

So for HubSpot, all you do is come in here, you click API key and when you click here, it’ll show you where you grabbed that from. Copy, paste that in. Then it’ll ask for your hub ID. You’ll click this, it’ll bring you exactly to the place where you can find that HubSpot ID, copy and paste that in.

Danny Lambert:

Your destination is set up and that is literally the entire setup for you to get your destination squared away. So for my destinations, let’s go ahead and use, I can use any one of these, just Mailchimp for sake of the argument because a lot of people use that tool. So at this point I would expect that when I log into this dummy Mailchimp account that that new user that we just created at lar@test.com will be in my list.

Danny Lambert:

So you come in and there it is lar@test.com. The beauty of this is now, that information is now in every single one of these tools via Segment, as well as every activity that I want to track after the fact. If I proceeded after this to go abandon during a funnel and it’ll tell me what page I abandoned on, what my cart value was, and it’ll send to all these different tools in the exact same time, which is essentially one line of code or a handful of lines of code.

Danny Lambert:

So that’s pretty much the extent of the most basic setup for a Segment. If you want me to create more videos on something more advanced, topics on what you’re able to accomplish with this, please let me know. I’m more than happy to make those. But hopefully this is helpful for you guys and happy marketing.

Leave a Reply

Your email address will not be published. Required fields are marked *