Segment.io is a Customer Data Platform that enables the transfer and collection of data between different sources and destinations. Segment.io collects information about events occurring on a specific application or site, and then transmits this data to Segment's servers, transforms it to the desired format, and passes it on to the tools that are destinations (usually analytics tools).
The integration with Segment uses webhook limits for sending data from Segment to Voucherify.
The integration updates only the defined customer metadata. The undefined metadata or data that does not match the defined data type is omitted.
By implementing our new connector that helps you push data from a promotion engine to a Customer Data Platform (CDP) and the other way around, your business can leverage its customer attributes to create targeted promotions. For example, the promotions can be based on customers' past purchases, browsing history, demographics, and actions, such as leaving a review.
Segment's event tracking and user identification capabilities can be effectively used to automatically trigger Voucherify campaigns, personalize incentives, and measure the effectiveness of campaigns in real-time.
The integration between Segment.io and Voucherify is bidirectional: outbound and inbound. In other words, Voucherify can be configured as both the Destination and Source of customer data.
Outbound integration between Segment and Voucherify
The outbound integration provides a continuous flow of customer data from Segment to Voucherify. The data received from Segment enable you to:
- Track custom events in Voucherify
- Create or update customers in Voucherify
- Group customers
To create an outbound integration between Voucherify and Segment.io, create a source on your Segment.io account that you want to integrate. Head to Sources and click Add source. Inside of the catalog, there are three main categories: Sources, Destinations, and Functions. You can find Voucherify in the destinations category in the referrals section.
For Segment to send information to Voucherify, we first need to connect Voucherify as Segment’s destination.
- Choose Voucherify from Segment’s Catalog and choose your sources to connect the destination.
- Use Voucherify’s integrations keys to authenticate the connector. In Voucherify, go to Dashboard and Project Settings. In the General tab, scroll down to Integration keys. Fill in the Name and choose your Role from the drop-down list. Choose Segment from the Integration drop-down list and click the Create Integration API Key button.
Important: the integration secret key is visible only for 15 minutes when it is generated for the first time or regenerated. Write your key down and keep it in a safe place.
- Paste your keys into the new source settings in Segment.
- Fill in the Custom Voucherify URL field. Go to Voucherify Dashboard > Project Settings > General tab. In the
Application Information section, scroll down to API endpoint. For example, if your API endpoint is
https://api.voucherify.io, the Custom Voucherify URL will be
https://segmentio.voucherify.io. You can also use dedicated URLs.
Inbound integration between Segment and Voucherify
The inbound integration supports the flow of data the other way around – from Voucherify to Segment. The integration supports the following events to be sent to Segment:
EVENTS.CUSTOMER.REDEMPTION.SUCCEEDED EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.SUCCEEDED EVENTS.CUSTOMER.REDEMPTION.FAILED EVENTS.CUSTOMER.REDEMPTION.ROLLBACK.FAILED EVENTS.CUSTOMER.REWARD_REDEMPTIONS.CREATED EVENTS.CUSTOMER.REWARD_REDEMPTIONS.COMPLETED
Note that only these events that have a customer attached to them will be sent from Voucherify.
When you have set up the outbound integration and created a new source, click your source to see more information such as the Write Key. This key is needed for the inbound integration.
If you want to have a two-way integration, you need to paste it in the Voucherify dashboard. Go to the Integrations tab, scroll down to Segment.io, and click Connect.
Note that the default region is set to US (Oregon), but it is also possible to send data to an EU endpoint. After connecting to Segment, click Settings in the integration and select the proper region.
Note that the events which are sent to Segment by Voucherify are flattened. This means that Voucherify will not send highly nested objects at this point.
Now, Voucherify will know where to send its information – Segment will also be able to display all the events from Voucherify, including code publication.
Consequently, you can now connect Voucherify source to a destination that delivers the promo codes via email or push notification to enable discount code redemption.
Remember: in order to have all your customer actions displayed, you must first connect Voucherify Source to a given space. Go to Unify Settings > Profile sources and click Connect source.
See the full set-up instructions by viewing Segment’s integration documentation.
You can check if the connection works properly and data are sent between Segment.io and Voucherify. First, try the inbound integration.
Redeem a voucher in the dashboard and see if any notification appears on the Segment account. After redeeming the voucher, head to your Segment account and click Connections > Sources. Select your source and click Debugger. There, you can keep track of all the actions that have taken place including the redemption that was made seconds ago.
Click the redemption to see more details regarding the event.
If all the information shows proper data that were sent between the two sources, you can test the outbound integration.
Go to Connections > Destinations. Select your destination and go to Mappings.
Here, you can choose between already existing mappings or add a new one by clicking New Mapping in the upper right corner.
Follow the Create or Update Customer mapping, click on the three dots and edit the mapping.
In the second step, select the Load Sample Event option.
The third step shows information defining mappings that can be used. In the example, the
trait1 is changed to
phone. You can see these changes being also implemented at the bottom of step 3 window.
When ready, you can select test mapping at the bottom of the page.
In the example, you can see that the customer was successfully created by being added to the customers in the dashboard.
You can also check the details of this event by going to your Audit Log with Voucherify.
This shows that the integration works both ways the way it is intended.