Skip to main content
All CollectionsIntegrations
How to integrate with Segment
How to integrate with Segment
Updated over 7 months ago

You can integrate your Retention.com account directly with Segment.

An integration between Retention.com and Segment does two things:

  1. Automatically sends contacts from your Retention.com account to Segment.

  2. Automatically sends Reclaim events from Retention.com to Segment.


What you'll need from Segment

1. Your Segment Write Key.

In your Segment account, go to Connections > Sources. Then, click Add Source.

2. Under Server, select HTTP API.

3. Click Add Source.

4. Name the source Retention.com or similar, then click Add Source.

5. Copy your Write Key. Paste it somewhere handy, you'll need it in a moment!


Setting up the integration

1. Click on Integrations from the left navigation panel in Retention.com. Then, click Available Integrations at the top and click the Segment icon or use the search to pull it up quickly:

2. Activate Grow and Reclaim, enter the Write Key you created and put somewhere handy earlier, then click Connect.

3. Set up Contact Suppression.

This integration does NOT offer daily automated suppression of your known contacts, therefore, you must set this up via API. Click here for more information.

You may proceed to the next step, however, suppression is critical for ensuring we do not pass you contacts you already have.

4. Select YES to upload contacts, and add the Group ID you'd like to apply.

If you check the box to enable custom sync options, that will display five options: filter by email domain, full or portion of a landing page URL, landing page domain, state*, and referrer URL.

*Note that State is only an option to filter by if you're on a legacy plan that includes address data.

This feature allows you to filter your Retention.com contacts before you send them to your ESP. For example, you can send all contacts who hit different landing pages to separate lists.

Expand for definition of filters

Email domain: This field auto-fills/populates with email domains (ex. Gmail, Yahoo Mail, AOL, etc.) from your collected contacts.

Full or portion of a landing page URL: If you’ve put the script on several pages or the entire site, this field allows you to pull out contacts who have only hit Landing Page A or Landing Page B. This option does not auto-populate, so you will have to add in the exact URL.

Landing page domain: If you added script to both Retention.com and Robly.com, for example, the landing page domain would be either Retention.com or Robly.com. This field will auto-populate.

State: This filter allows you to pull out only contacts from one or more states. Note that State is only an option to filter by if you're on a legacy plan that includes address data.

Referrer URL: This is the URL the contact comes to your site from.

When you're finished, click Next.

5. Click Yes to enable Reclaim Sync.

6. Select Enable and Finish to complete the integration setup.

7. Once the integration is complete, you will see the integration date, API details, and all other setting details from the Settings page. You can also Remove the integration from this page at the top.


Integration Settings

From your Integration settings, you can access, change, or update any of the following:

  • Your API key

  • Grow or Reclaim Activation

  • Suppression settings

  • Grow Sync settings, including the list you're syncing contacts to

  • Revenue metric

  • Sync summary

  • Reclaim sync

To access any of these settings, go to your Retention.com dashboard and click Integrations > Dots > Settings.


Sync summary

You can view your daily sync history under Sync Summary on your integration's settings page. It will show you the date, number of completions, if there are any failures, and the number that are in the queue.

To access all of your sync history, click on a specific date or View Full History under Sync Summary. If there's a failure, it will show the email address, what type of failure has occurred under ESP Feedback, and the date and time of the failure.


Segment Payloads

Expand the sections below to see the format of the data that will be sent to to your Segment integration.

Grow contact payload

Here's an example of a Grow contact payload using "anonymousId":

"anonymousId": "224ee0abc232ba012cc7932ca74609d9",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"integrations": {},
"messageId": "api-2fBtljNDdeWNJCnhTKt2IYMSFwc",
"originalTimestamp": "2024-04-16T16:54:09.697Z",
"receivedAt": "2024-04-16T16:54:10.697Z",
"timestamp": "2024-04-16T16:54:09.697Z",
"traits": {
"address_city": null,
"address_line_1": null,
"address_postal": null,
"address_state": null,
"clicked_at": "2024-04-16T16:54:09.668Z",
"created_at": "2024-04-16T16:54:09.668Z",
"email": "user_testing1@retention.com",
"email_domain": "retention.com",
"extra_data": null,
"first_name": null,
"id": 6,
"landing_page_domain": "haley-runolfsdottir.example",
"landing_page_url": "http://haley-runolfsdottir.example/launa",
"last_name": null,
"page_title": null,
"referrer": "http://huels.test/brianne",
"updated_at": "2024-04-16T16:54:09.668Z"
},
"type": "identify"
}

Here's how that payload looks in Segment:

Reclaim event payloads

Viewed Category Reclaim

Here's an example of a Viewed Category Reclaim event payload using "anonymousId":

"anonymousId": "a695d9cffa3a88572b6735fc9e742e82",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"email": "user_testing5@retention.com",
"event": "Viewed Category Reclaim",
"integrations": {},
"messageId": "api-2fBtoemXhkvlrIFJpHyqO84xPWq",
"originalTimestamp": "2024-04-16T16:54:32.697Z",
"properties": {
"EventSource": "Reclaim",
"Name": "Marshmallows",
"URL": "http://mccullough.example/albert.mosciski",
"brand": "Cupcake",
"image_url": "https://loremflickr.com/300/300",
"name": "Marshmallows",
"price": 8,
"product_id": 6702700412,
"url": "http://mccullough.example/albert.mosciski"
},
"receivedAt": "2024-04-16T16:54:33.632Z",
"timestamp": "2024-04-16T16:54:32.697Z",
"type": "track"
}
"anonymousId": "a695d9cffa3a88572b6735fc9e742e82",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"email": "user_testing5@retention.com",
"event": "Viewed Category Reclaim",
"integrations": {},
"messageId": "api-2fBtoemXhkvlrIFJpHyqO84xPWq",
"originalTimestamp": "2024-04-16T16:54:32.697Z",
"properties": {
"EventSource": "Reclaim",
"Name": "Marshmallows",
"URL": "http://mccullough.example/albert.mosciski",
"brand": "Cupcake",
"image_url": "https://loremflickr.com/300/300",
"name": "Marshmallows",
"price": 8,
"product_id": 6702700412,
"url": "http://mccullough.example/albert.mosciski"
},
"receivedAt": "2024-04-16T16:54:33.632Z",
"timestamp": "2024-04-16T16:54:32.697Z",
"type": "track"
}

Here's how that payload looks in Segment:

Viewed Product Reclaim

Here's an example of a Viewed Product Reclaim event payload using "anonymousId":

{
"anonymousId": "165ac1286d182f6998bc3236affbda09",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"email": "user_testing3@retention.com",
"event": "Viewed Product Reclaim",
"integrations": {},
"messageId": "api-2fBtnWAtJqhvtvIlD5dEnBus0Ik",
"originalTimestamp": "2024-04-16T16:54:23.497Z",
"properties": {
"Brand": "Coffee Cake",
"Currency": "",
"CurrencyPrice": "$47",
"EventSource": "Reclaim",
"ImageURL": "https://loremflickr.com/300/300",
"Name": "Chocolate Sprinkles",
"Price": "47",
"ProductID": 9229193849,
"URL": "http://rempel-collier.example/salvador_bogan",
"Variant": "",
"VariantID": "",
"brand": "Coffee Cake",
"image_url": "https://loremflickr.com/300/300",
"name": "Chocolate Sprinkles",
"price": 47,
"product_id": 9229193849,
"url": "http://rempel-collier.example/salvador_bogan"
},
"receivedAt": "2024-04-16T16:54:24.321Z",
"timestamp": "2024-04-16T16:54:23.497Z",
"type": "track"
}

Here's how that payload looks in Segment:

Add to Cart Reclaim

Here's an example of an Add to Cart Reclaim event payload using "anonymousId":

{
"anonymousId": "6c51ac0761f7db42cbf6726b4df6d441",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"email": "jorge@retention.com",
"event": "Add To Cart Reclaim",
"integrations": {},
"messageId": "api-2fBtmil7sIb22hp0VuCVKKO4JOQ",
"originalTimestamp": "2024-04-16T16:54:17.519Z",
"properties": {
"Brand": "Brownie",
"CartSource": "GE",
"CompareAtPrice": "",
"Currency": "",
"CurrencyPrice": "$64",
"EventSource": "Reclaim",
"ImageURL": "https://pigment.github.io/fake-logos/logos/medium/color/2.png",
"Name": "Berry Compote",
"Price": "64",
"ProductID": 4891833341,
"Quantity": 1,
"URL": "http://krajcik.test/emerita",
"Variant": "",
"VariantID": ""
},
"receivedAt": "2024-04-16T16:54:18.505Z",
"timestamp": "2024-04-16T16:54:17.519Z",
"type": "track"
}

Here's how that payload looks in Segment:

Checkout Started Reclaim

Here's an example of a Checkout Started Reclaim event payload using "anonymousId":

{
"anonymousId": "6c51ac0761f7db42cbf6726b4df6d441",
"context": {
"app": {
"name": "retention",
"version": "1.0"
},
"library": {
"name": "unknown",
"version": "unknown"
}
},
"email": "jorge@retention.com",
"event": "Checkout Started Reclaim",
"integrations": {},
"messageId": "api-2fBtpI6fKSb27s567KICPrJ7jQy",
"originalTimestamp": "2024-04-16T16:54:38.321Z",
"properties": {
"EventSource": "Reclaim",
"cart_amount": 78.05,
"cart_id": "aea3ijd1scjzdv071h",
"currency": "USD",
"line_items": [
{
"id": 2804981569430,
"quantity": 3,
"title": "Frosting",
"variant": {
"id": 4109397553956,
"image": {
"src": "https://loremflickr.com/300/300"
},
"price": {
"amount": 0.05,
"currency_code": "USD"
},
"product": {
"id": 8040897659578,
"title": "Ice Cream",
"type": "Chocolate Sprinkles"
},
"sku": "fylqm75",
"title": "Pie"
}
}
],
"test_event": true
},
"receivedAt": "2024-04-16T16:54:39.252Z",
"timestamp": "2024-04-16T16:54:38.321Z",
"type": "track"
}

Here's how that payload looks in Segment:

If you have questions, you can contact support at support@retention.com!

Did this answer your question?