Swapt
Guides

Using Attentive with Swapt

Subscribe the customers you capture with Swapt to your Attentive SMS and email marketing, and send an event that triggers an Attentive journey.

If you run your texts and emails in Attentive, Swapt can feed it. Customers scan, fill in your form, and get subscribed in Attentive, with an event you can use to start a journey that delivers their reward and asks for a review.

The big picture

  1. Swapt captures the customer and subscribes them with an Attentive: Subscribe step. They're subscribed to texts if they gave a phone number, and to email if they gave an email address.
  2. An Attentive: Track Event step sends an event, Submitted Swapt Code by default, with the details you choose.
  3. Attentive uses that event to trigger a journey that delivers the reward and asks for a review.

Step 1: Find your API key and sign-up unit in Attentive

You need two things from Attentive before you connect:

  • An API key. In Attentive, go to Settings → API, create a Custom App / Private App, and copy its API key.
  • A Sign-up Source ID. This is the ID of an API sign-up unit. In Attentive, open Sign-up Units and copy the number in the ID column. Attentive won't subscribe anyone without one, because the sign-up unit carries the legal disclosure for the opt-in.

Create a sign-up unit just for Swapt. It keeps your Swapt subscribers easy to find and report on in Attentive.

Step 2: Connect Attentive

Open Integrations from the bottom of the left-hand menu and click the Attentive card.

Paste your API key, and your Sign-up Source ID as the default.

Click Connect Attentive. Swapt checks the key with Attentive before saving it, so if it's wrong you'll know straight away.

Click Need Help? on the card if you want these steps beside you. See Integrations.

Step 3: Add the Attentive steps to your flow

Do this after your pages and the rest of the flow are built.

After the step that shows your form, add Attentive: Subscribe. Under Subscription Settings, enter your Sign-up Source ID.

Leave Skip double opt-in unticked. See Double opt-in below.

Below it, add Attentive: Track Event. Leave Event Type set to Submitted Swapt Code, or choose Custom Event and enter a Custom Event Name.

Under Custom Properties, click Add Property for each detail you want in your messages. Each property has a Key (the name Attentive sees) and a Value (a Swapt variable). See the table below.

Click Save and choose Save & Publish.

Enter the Sign-up Source ID on every Attentive: Subscribe step, even though you saved a default when you connected. Swapt flags a Subscribe step without one before you publish, because Attentive would turn away every customer who reached it.

Custom event names can use letters, numbers, spaces, and _ . -. Attentive doesn't accept quotes, brackets, or commas in event names.

Useful properties

Swapt always sends the customer's first and last name with the event, so you don't need to add those. Add anything else you want to use in your messages:

Key (your choice)ValueWhy you'd use it
product{formData.product.value}The ASIN of the product the customer picked on the form.
review_url{formData.product.reviewUrl}A ready-made review link for the product they picked: the Amazon review page for Amazon products, or the Judge.me review form for Shopify products.
review_url{campaignProduct.reviewUrl}The same, for the product attached to the campaign. Use this when each campaign covers one product.
channel_source{formData.channel_source}Where they bought, from your form's Channel Source field. Use it to change your message copy by channel.
promotion{promotion.promotionalCode.code}The unique code Swapt gave them, so you can show it in the message. It only has a value when an Apply Promotion step comes before this step.

The formData.product values need a Product field on your form. Use campaignProduct instead when each campaign is tied to one product. See Planning your first QR campaign.

Send a test

Submit your form once yourself, using your own phone number and email. In Attentive, look yourself up and check that you were subscribed and that the event arrived with the properties you set up. If double opt-in is on, you'll get the "Reply Y" text first. Reply to it to finish subscribing.

Double opt-in

By default, Attentive texts each new subscriber asking them to reply "Y" before they get any marketing texts. That's Attentive's own default, and Swapt keeps it.

Ticking Skip double opt-in subscribes customers without that text. Only do this if Attentive has cleared single opt-in for your sign-up unit. Attentive asks brands to check with them first. Swapt shows a warning on the step while it's ticked.

Step 4: Build the journey in Attentive

In Attentive, create a journey triggered by your custom event (Submitted Swapt Code, unless you named your own). Attentive needs to have seen the event once, so send your test submission first.

That journey has two jobs:

  • Deliver the reward you promised on the landing page.
  • Give a second chance to review, for customers who didn't review on the success page.

The review link: use the review_url property you sent. Because Swapt builds the right link for you, you don't need separate logic for Amazon and Shopify products.

The coupon: send codes handed out by Swapt (Shopify codes, or Amazon codes you've uploaded to Promotions) as the promotion property and show that property in the message.

When the journey looks right, turn it on in Attentive. Then test it end to end with the same phone number and email you used in Swapt.

Don't send two welcome messages. If Attentive already sends a welcome journey to new subscribers from this sign-up unit, leave any welcome Send Email or Send SMS step out of your Swapt flow.

Troubleshooting

Customers aren't showing up in Attentive

The Attentive steps look for form fields keyed exactly email, and phone or phoneNumber. Keys are case-sensitive, so Email or Phone won't match. A customer with neither is skipped. For the names sent with the event, the keys are firstName and lastName.

To check:

Open your landing page in the page editor, select the Form block, and click Edit Form Builder.

Click each name, email, and phone field. Under Field Settings, look at its Field key.

If a key doesn't match, click the lock icon next to Field key to unlock it, type the right key, then save the page.

The built-in First Name, Last Name, and Email fields already use the right keys. This usually happens when a plain Text field was used, or a key was edited by hand. Send another test submission once you've fixed it.

Customers got email but not texts

Attentive only accepts complete phone numbers. Swapt reads numbers without a country code as US numbers, so customers outside the US need to enter theirs with the country code, like +44. If Swapt can't read a number, it still subscribes the customer by email when they gave one.

If customers were subscribed but never got texts, check whether they replied "Y" to the double opt-in text.

You connected the wrong Attentive account

In Swapt, open Integrations, stay on the Apps tab, and click the Attentive card.

Click Disconnect, then Yes, disconnect it!

Connect again with the API key and Sign-up Source ID from the right Attentive account.

Then open each Attentive: Subscribe step in your flows and enter the new account's Sign-up Source ID, since sign-up units from the old account won't exist in the new one.

On this page