This preview of pull request 1639 is meant for internal use only.

Voucherify Destination

Voucherify quick info

Voucherify is in beta, and accepts Track, and Identify calls. If you reference it in the Integrations object, call it “Voucherify”.

Voucherify helps developers integrate digital promotions across any marketing channel or customer touchpoint - eventually giving full control over campaigns back to the marketing team.

This destination is maintained by Voucherify. For any issues with the destination, contact the Voucherify Support team.

This document is about a destination which is in beta

This means that the Voucherify Destination is in active development, and some functionality may change before it becomes generally available.

Getting Started

  1. From the Segment web app, click Catalog.
  2. Search for “Voucherify” in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. Enter the “API Key” and “API Token” into your Segment Settings UI which you can find from your Voucherify dashboard.

Getting API Key and API Token

On the Voucherify Dashboard page:

  • Open the “Project settings” from the user context menu on the top right.
  • Find the “Application Keys” section on the project page.
  • Create a new key pair if needed.
  • Use “Application ID” and “Secret Key” respectively as “API Key” and “API Token”.

Identify

If you’re not familiar with the Segment Specs, take a look to understand what the Identify method does. An example call would look like:

analytics.identify('cust_9032_re_3234', {
  email: 'john.doe@example.com'
});

Received events will be carried to Voucherify.io as a Customer Create request unless the setting Identify Disabled is true.

The Customer is created, with a source_id equal to the event userId or anonymousId. When exists, an existing Customer is updated.

With setting Identify Mapping you can customize the conversion from the event payload to Voucherify Customer payload.

# Default identify event mapping (src : dest)
{
  "traits.name"              : "customer.name",
  "traits.firstName"         : "customer.firstName",
  "traits.lastName"          : "customer.lastName",
  "traits.email"             : "customer.email",
  "traits.description"       : "customer.description",
  "traits.address.city"      : "customer.address.city",
  "traits.address.state"     : "customer.address.state",
  "traits.address.street"    : "customer.address.line_1",
  "traits.address.country"   : "customer.address.country",
  "traits.address.postalCode": "customer.address.postal_code",
  "traits.phone"             : "customer.phone",
  "traits.metadata"          : "customer.metadata"
}

Track

If you’re not familiar with the Segment Specs, take a look to understand what the Track method does. An example call would look like:

analytics.track('Registration Completed', {
  name: 'Customer Name'
});

Received events will be carried to Voucherify.io as Custom Events related to the Customer, with an event name equal to segment event value, unless the setting Track Disabled is true.

The Custom Event is attached to a Customer, with a source_id equal to the event userId or anonymousId. The userId field is a field which persists from when you first make an identify call on a JavaScript source. The anonymousId field is a randomly generated field that will be generated when you call a track event. The userId will take priority if anonymousId exists. If userId doesn’t exist, the anonymousId will be used.

With setting Track Events Filter you can define the list of allowed events that will be transferred.

With setting Track Mapping you can customize the conversion from the event payload to Voucherify Custom Event payload.

# Default track event mapping (src : dest)
{
  "properties.name"              : "customer.name",
  "properties.firstName"         : "customer.firstName",
  "properties.lastName"          : "customer.lastName",
  "properties.email"             : "customer.email",
  "properties.description"       : "customer.description",
  "properties.address.city"      : "customer.address.city",
  "properties.address.state"     : "customer.address.state",
  "properties.address.street"    : "customer.address.line_1",
  "properties.address.country"   : "customer.address.country",
  "properties.address.postalCode": "customer.address.postal_code",
  "properties.phone"             : "customer.phone",
  "properties.metadata"          : "customer.metadata"
}

Voucherify Custom Event

Payload mapping

The received event payload is translated, with the specific event mapping (track or identify), to a Custom Event payload.

Regardless of the provided mapping, some fields have a fallback mapping logic:

  • event when not defined, using the event property from the event, if not defined then the event type.
  • customer.source_id when not defined, using userId or anonymousId from the event.
  • customer.name when not defined, trying to build one from firstName and lastName.

Personas

You can send computed traits and audiences generated using Segment Personas to this destination as a user property. To learn more about Personas, contact us for a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Personas sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Personas sets that value to false.

When you first create an audience, Personas sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

API Key

To get ApiKey and ApiToken, please check the Voucherify.io documentation and follow the instructions on the page: https://docs.voucherify.io/docs/authentication

API Token

Voucherify App Token

API URL

Voucherify API Url, default: https://api.voucherify.io

API Version

Voucherify API Version, default: latest

Identify Disabled

Check if identify event should not trigger CustomEvent sync. default: false

Identify Mapping

Identify event object mapping. default: { traits: customer }

Ignore Anonymous

Check if want to filter events with anonymousId. default: false

Track Disabled

Check if track event should not trigger CustomEvent sync. default: false

Track Events Filter

Provide a list of track events that trigger the CustomEvent sync. default: all events allowed.

Track Mapping

Tack event object mapping. default: { properties: customer }

Track Only Existing Customers

Check if want to block track events for nonexistent customers.

This page was last modified: 20 Oct 2020



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account