Segment as an action is very useful for companies that use Segment as a CDP (Customer Data Platform). For example, a company might be tracking web events with Segment and sending its transactional data into Segment, to then funnel that data into different business applications.
With this Action Datagran customers can send the output of Pipelines containing Machine Learning models into Segment. The inputs required by this Action are the following:
Write Key: Is an API Key that will allow Datagran to send data via the Segment's REST API. For instructions on how to get the Write Key go here.
Table: It refers to the table that you want to extract data from. Datagran will automatically detect your table once you connect the Segment Action to the specific operator (usually a SQL operator).
Event name: Refers to the event that will hold your properties. For example an event could be "Sales Predictions".
Properties: Refers to the properties contained in an event. You can have as many properties as you want.
Customer id: Refers to the customer ID in your database. If the user exists in Segment we will update the event and properties. If not, we will create a new customer.
A simplified pipeline example with a Segment Action would look like this:
To be able to use Segment as an Action, you will need to create an HTTP Source in your Segment Dashboard. It should look something like this:
The output that Segment will get will be something like this:
analytics.track('162514333', 'Sales Prediction', {
'iphone': '0.734',
'apple_watch': '0.812'
})
As mentioned before this method has a user_id
string, an event
string and a properties
string.