|
| 1 | +--- |
| 2 | +# The end name should be similar to `Slack Destination` |
| 3 | +title: Loops |
| 4 | +hide-boilerplate: true |
| 5 | +hide-dossier: true |
| 6 | +--- |
| 7 | + |
| 8 | +{% include content/plan-grid.md name="actions" %} |
| 9 | + |
| 10 | +[Loops](https://loops.so){:target:="_blank"} is an email platform for SaaS. |
| 11 | + |
| 12 | +You can use this Segment integration to create and update your Loops contacts as well as trigger email sending via events. |
| 13 | + |
| 14 | +<!-- This include describes the requirement of A.js 2.0 or higher for Actions compatibility, and is required if your destination has a web component. --> |
| 15 | + |
| 16 | +{% include content/ajs-upgrade.md %} |
| 17 | + |
| 18 | +<!-- The section below explains how to enable and configure the destination. Include any configuration steps not captured below. For example, obtaining an API key from your platform and any configuration steps required to connect to the destination. --> |
| 19 | + |
| 20 | +## Getting started |
| 21 | + |
| 22 | +1. From the Segment web app, click **Catalog**, then click **Destinations**. |
| 23 | +2. Search for “Loops (Actions)” in the Destinations Catalog, and select the destination. |
| 24 | +3. Click **Configure Loops**. |
| 25 | +4. Select an existing Source to connect to Loops. |
| 26 | +5. Generate an Loops API key from [Settings > API](https://app.loops.so/settings?page=api){:target="_blank"}. Click "Generate key" then click the "Copy to clipboard" icon. |
| 27 | +6. Back in Segment, go to the Settings page inside your Loops destination and paste your API key then click "Save Changes". |
| 28 | + |
| 29 | +## Create or update contacts |
| 30 | + |
| 31 | +You can create and update Loops contacts by using Segment's [Identify method](https://segment.com/docs/connections/spec/identify/){:target="_blank"}, like this: |
| 32 | + |
| 33 | +```javascript |
| 34 | +analytics.identify("test-user-a5h7xb", { |
| 35 | + |
| 36 | + firstName: "Adam", |
| 37 | + favoriteColor: "blue", |
| 38 | + favoriteNumber: 42 |
| 39 | +}); |
| 40 | +``` |
| 41 | + |
| 42 | +All traits in this call can be applied to your Loops contacts using mappings. Go to the Mappings tab and click "New Mapping". Select "Create or update a contact". |
| 43 | + |
| 44 | +It is important that you set up the data mapping properly in step 3 of the form. This is where you can select which data is sent on to Loops and into which fields. We provide an example default mapping in the form but you should make sure that you set up the mapping to capture the correct data into the correct fields (you may have some custom fields that the default mapping doesn't cover). |
| 45 | + |
| 46 | +Any custom fields you are using in Loops can be passed inside "Custom Contact Attributes". |
| 47 | + |
| 48 | +We have a full tutorial for creating and updating contacts [in our docs](https://loops.so/docs/add-users/segment#create-or-update-contact){:target="_blank"}. |
| 49 | + |
| 50 | +## Sending events |
| 51 | + |
| 52 | +In Loops you can send emails [triggered by events](https://loops.so/docs/loop-builder/triggering-emails){:target="_blank"}. You can send these events to Loops through Segment by using the [Track method](https://segment.com/docs/connections/spec/track/){:target="_blank"}. |
| 53 | + |
| 54 | +```javascript |
| 55 | +analytics.track("User Registered"); |
| 56 | +``` |
| 57 | + |
| 58 | +To trigger email sending with Segment, go to the Mappings tab and click "New Mapping". Select "Send Event". |
| 59 | + |
| 60 | +In the next page enter the name of the event you're tracking in Segment into the "Event Name" field (e.g. "User Registered" from the example above). |
| 61 | + |
| 62 | +Read our tutorial for sending events [in our docs](https://loops.so/docs/add-users/segment#send-event){:target="_blank"}. |
| 63 | + |
| 64 | +<!-- The line below renders a table of connection settings (if applicable), Pre-built Mappings, and available actions. --> |
| 65 | + |
| 66 | +{% include components/actions-fields.html %} |
| 67 | + |
| 68 | +<!-- |
| 69 | +Additional Context |
| 70 | +
|
| 71 | +Include additional information that you think will be useful to the user here. For information that is specific to an individual mapping, please add that as a comment so that the Segment docs team can include it in the auto-generated content for that mapping. |
| 72 | +--> |
0 commit comments