How to Integrate Segment into Braze - Thread the Needle with Braze

Braze empowers marketers to access and harness consumer data for personalized and dynamic marketing from across various marketing platforms.

In this video, Kaleigh Porter, a Solutions Architect at Stitch, explains how to connect Segment to the Braze platform to send user data. The process involves configuring a Braze integration in Segment, setting up mappings for different types of calls, and troubleshooting any errors to customize the data transfer effectively.


 Hi, this is Kaleigh from Stitch, and today we're going to be covering how to connect Segment in order to send user data into the Braze platform. So in order to get started, we will start with our segment. I already have a source created. This is an analytics.js source and, I can send data into it through Postman and other ways for testing purposes.

We'll first want to go to the added destination and search through the catalog for the type of integration we'd like to create, which we will do a Braze CRM integration. There are multiple types of connections that you can do between Braze and Segment, and you can send data in various ways. Today we're going to be focused on capturing, engagement, and identifying data or user data for using a cloud destination source. You can review it on the Segment website. There's lots of great resources, whether it's on the Braze documentation or the Segment documentation. You can also see different types of compatibility and read through the documentation for more details. But for now, we're just going to go through and hit the Configure Braze button.

Then we just need to give it a name, so Braze the Bar demo. Again, I mentioned we're going to be collecting our data today in cloud mode and we're going to keep this actions framework, and then we'll hit the create destination. Alright, now we are on our destination screen. It is copying over my key from another place, but I just wanted to really quickly show you how to capture that. So if we go over to our  Braze platform, you'll find this in your settings and then API keys in this menu here.

You can create a new API key and give it just basic permissions that you will need. I can show you here  with the key that I created. I did all of the user data that's related to adding new user data, but I did not choose any user data that is related to exporting. Then for email, I allowed the status to be updated.

It is best practice for  your API keys to have a minimum amount of permissions available and also for you to use specific API keys for specific purposes in case you ever need to deprecate a key and revoke access to a specific platform or partner. I will be removing this identifier from my platform, following this video. 

So I'll go ahead and copy my API key and come back over  here and just make sure that I have the new key updated. And then we'll also need an app ID here.  So for me, my app ID can be found just a little bit lower down. And these are the types of different apps that I have available in my workspace. So for this one, I'm going to do a web app because this is an analytics.js source.

So I'll grab this API key and pull that over and place it in here. And then I will hit save changes and we will be all set to go. Once these settings are done and we have this destination enabled, we'll be able to move to the next step, which is going to be mappings. For the purpose of this demo, I've got everything pulled up and ready to go so we can move through this quickly.

So I'll just go to this next tab over here, which is mappings for my track call. When you first start with this integration, there's going to be three types of mappings that are pre-configured for you. They are track calls, purchase events, and identify calls. So here in the track call you'll notice that we are going to do any type of track as long as the event name is not order completed.

This is because Braze tracks purchase data separately, and we want to make sure that we are sending them correctly. Any track call that is not order completed will flow through this particular event. The next thing is it's going to be a test event. You can actually click in here and load a test event from the source.

What this is going to do is load a previously sent segment event from your debugger, and just load in that payload for you. You can make edits to this payload while you're in here as well, but that'll preload it. And then here's the really cool part — selecting the mappings and being able to really customize how your data from Segment is going to map into Braze's cloud mode.

So here you can see the event is going to map to event name. There's times stamp, the user ID, which is really important there for the Braze identification for the users, properties and what have you. And then here at the very bottom, we can send a test event, so we're going to go ahead and hit test again.

We can see that we're gonna use my Braze the Bar user one, and we're sending a product search event. So let's go ahead and hit test mapping and it will tell me if it was successful. So now I can come over to my user's tab and look for the user who we just sent over via the segment test integration, and here they are.

So right now we have essentially an anonymous user who has only completed a track event on our website. So this is their name, proxy. We have their user ID. And we can see that there was a product search that occurred 15 hours ago. My timestamps on my test payload just haven't been changed. So there is this profile, and then the next thing that we're going to do is add in the identify level of information here.

So this is another one of those pre-configured calls that you can visit by going to mappings and then going in and editing the mapping here. So for the identify calls, we're going to just say event type is identified. You could also add different conditions here if you need to create additional mappings for your use cases.

But for now we're just using the out of the box. Again, we have a pre-loaded test event from source so you can load the test event if you need a new one. And just make sure it's the same user here. And then here's where you can also go in and select your mappings. So we've got user ID, location, all types of different things, email address, and then a variety of specific traits.

So again, what we'll do here is test our mapping. Sometimes it takes just a moment for this to refresh, but we'll give it a moment here. And then we'll just hit refresh.

Alright. And now we have all this new identification information about the same user. So now their first name is Braze the, last name is Bar. We've got their email and phone number added in here. We've also mapped over some of their profile data, like female and where I'm from, which is Denver. And then in here, there's some custom attributes that came over from our payload, like login and the plan.

We still have our product searched in here because we're updating an existing profile with this new identified information. Alright so one thing I wanna note here is if you need to edit your payload. How you can go about doing that. So there's one piece of information that's in my payload here that was not mapped over into my profile, and that is the date of birth.

So here's the date of birth and we want to pull that into our payload. So you can find here that there is a date of birth attribute that we can load to in Braze but we haven't loaded that yet. So if you click here on the mapping side and search for our payload name, you'll find it here in the dropdown, and it will actually show you a preview of what that data will look like when it comes over.

So now we have date of birth set up as part of the mapping, and if we reload and test this mapping again. In just a moment here, we'll notice that my birthday will populate.

Alright, let's go ahead and refresh. And now we not only have my birthday, but also Braze's out of the box functionality has categorized me into an age group.

So with that, you can configure all different types of attributes, both custom attributes, standard attributes, et cetera. And it is important here to note that Braze has specific usernames. In categories that you'll want to use. So in this resource here, and I can link this in the comments the default user data column headers, these are values that you'll want to use in your payloads so that when you're mapping over, you can make sure that you're using the the data points that Braze is expecting.

Alright, and then our last call here is going to be a order completed call. This one here, event name is order completed, so this is another type of track call, but it's specific to when an order has been completed. Again, we have already configured a payload here that we can send through and we have our mappings.

The reason I wanted to pull this one up is to show you what happens if your test has failed. So for this what's going on? Why is my root value missing for the required field products? These are going to give you some descriptive information about what to go track down. So in this case, there's something wrong with products.

So let's go try and figure out what's going on. So the first thing I can see is that my properties, products attribute and array here is supposed to be sending over into the product data for braise, but for some reason it's not. So let's go look at my payload, and if you scroll down through the payload, you'll want to find the products.

So here we have properties of our call, and then here are the products. Oh, and the reason that this is happening is that my developer set up my array to have my products rather than products. So there's a mismatch between my payload and the mapping information that I'm trying to send over.

So by correcting this to products, I should now be able to go ahead and test again. We'll test our mapping, and now we do have a success, so that's great. Alright, one more time. Now we'll go over to our users. We'll give it just a moment to refresh.

 And now we have some additional information in my profile here, which is some lifetime revenue, when I made my last purchase, and some product names that I have purchased. Looks like I need to do a little bit more mapping here to get the right product name in here. This is a product ID I believe. We can see how the power is really quickly sending data over from segment, configuring those mappings, troubleshooting any errors that you might have, and being able to fully customize what that mapping looks like. 

You might also like...