|
| 1 | +--- |
| 2 | +title: Rehook Destination |
| 3 | +id: 64c02312ff0ce798cc8d1a7e |
| 4 | +--- |
| 5 | + |
| 6 | +{% include content/plan-grid.md name="actions" %} |
| 7 | + |
| 8 | +[Rehook](https://rehook.ai/){:target="_blank"} is a powerful and dedicated user-incentivization solution that enables businesses to reward and engage users without depending on tech teams. With an elegant and easy-to-use interface, Rehook is designed to help you run user-promotion campaigns that are flexible, customizable and scalable. |
| 9 | + |
| 10 | +This destination is maintained by Rehook. For any issues with the destination, [contact the Rehook Support team ](mailto:[email protected]). |
| 11 | + |
| 12 | + |
| 13 | +## Getting started |
| 14 | + |
| 15 | +1. From the Destinations catalog page in the Segment App, click **Add Destination**. |
| 16 | +2. Search for **Rehook** in the Destinations Catalog, and select the **Rehook** destination. |
| 17 | +3. Select which Source should send data to the Rehook destination. |
| 18 | +4. Open the [Rehook Dashboard](https://dashboard.rehook.ai/){:target="_blank"} and navigate to **Settings > API Keys & Secret Key**. Copy your key. |
| 19 | +5. Open the Segment app and paste the **API Key & Secret Key** in the Rehook destination settings page. |
| 20 | + |
| 21 | + |
| 22 | +## Supported methods |
| 23 | + |
| 24 | +Rehook's destination is designed to support the following [Segment Spec](/docs/connections/spec) methods. Because this is an Actions Destination, you can also map other Segment methods. |
| 25 | + |
| 26 | +### Identify |
| 27 | + |
| 28 | +If you're not familiar with the Segment Spec, take a moment to understand what the [Identify method](/docs/connections/spec/identify/) does. |
| 29 | +An example call looks like this: |
| 30 | + |
| 31 | +#### Example 1: |
| 32 | +```js |
| 33 | +analytics.identify('userId12345', { |
| 34 | + firstName: 'Bob', |
| 35 | + lastName: 'Dole', |
| 36 | + |
| 37 | + company: 'Initech', |
| 38 | + employees: 234 |
| 39 | +}); |
| 40 | +``` |
| 41 | + |
| 42 | +#### Example 2: |
| 43 | +```js |
| 44 | +analytics.identify('userId12345', { |
| 45 | + firstName: 'Bob', |
| 46 | + lastName: 'Dole', |
| 47 | + |
| 48 | + company: 'Initech', |
| 49 | + employees: 234, |
| 50 | + referral_code: "ERTYUS" |
| 51 | +}); |
| 52 | +``` |
| 53 | + |
| 54 | +Every time you make an Identify call with an included `userId`: |
| 55 | + |
| 56 | +1. Rehook verifies that the `userId` exists. |
| 57 | +2. If the `userId` does not exist, Rehook adds the user as a Customer to the Rehook database and matches user properties with the Segment `traits` sent in the Identify call payload. |
| 58 | +3. If the `userId` exists, Rehook updates the user properties for the Customer against the Segment `traits` sent in the Identify call payload. |
| 59 | +4. If `referral_code` is unique, Rehook updates the user properties in its database. |
| 60 | + |
| 61 | +All of the [traits](/docs/connections/spec/identify#traits) recognized by Segment are translated and matched with the Rehook Customer user properties. These fields are automatically created or mapped for a Customer in Rehook and are available for personalization and advanced segmentation. |
| 62 | + |
| 63 | +> info "How Rehook handles incoming userId and referral_code in Identify calls:" |
| 64 | +> * The `userId` field is required. Rehook drops Identify calls without a userId. |
| 65 | +> * If a call is made with `anonymousID`, Rehook drops the Identify call. |
| 66 | +> * If `referral_code` matches with another `userId`, Rehook drops the Identify call. |
| 67 | +
|
| 68 | +### Track |
| 69 | + |
| 70 | +If you're not familiar with the Segment Spec, take a moment to understand what the [Track method](/docs/connections/spec/track/) does. |
| 71 | + |
| 72 | +An example call looks like this: |
| 73 | + |
| 74 | +#### Example 1: |
| 75 | +```js |
| 76 | +analytics.track('Product Viewed', { |
| 77 | + userId: "userId12345", |
| 78 | + product_id: '507f1f779439011', |
| 79 | + name: 'Monopoly: 3rd Edition', |
| 80 | + price: 18.99, |
| 81 | + url: 'https://www.example.com/product/path', |
| 82 | + image_url: 'https://www.example.com/product/path.jpg' |
| 83 | +}); |
| 84 | +``` |
| 85 | + |
| 86 | +#### Example 2: |
| 87 | +```js |
| 88 | +analytics.track('signup', { |
| 89 | + userId: "userId12345", |
| 90 | + referral_code: 'ERTYUS' |
| 91 | +}); |
| 92 | +``` |
| 93 | + |
| 94 | +Segment sends Track calls to Rehook as a Custom Event. When you make a Track call, Segment sends the event to Rehook with the event name and all properties that you specified. |
| 95 | + |
| 96 | +> info "How Rehook handles incoming userId and referral_code in Track calls:" |
| 97 | +> * The `userId` field is required. Rehook drops Track calls without a `userId`. |
| 98 | +> * If a call is made with `anonymousId`, Rehook drops the Track call. |
| 99 | +> * The `referral_code` field is required if event name is set as a conversion event in Rehook. |
| 100 | +
|
| 101 | +{% include components/actions-fields.html %} |
0 commit comments