Skip to main content
Emotive + Amped
Maggie Buchanan avatar
Written by Maggie Buchanan
Updated over 10 months ago

How to Integrate Emotive with Amped

Integrating Emotive with Amped allows you to send phone numbers from Amped to Emotive using the Emotive API. Follow these steps to set up the integration:
​

1. Sign in to Emotive and create a new "Signup" of type "Desktop Wisepops." Name the signup "Amped" and link it to an existing experience in Emotive (such as an SMS flow).
​

Setting up the new Signup entry point in Emotive

2. Once you've created the signup, Emotive will generate an API Key. Copy this key to use later.

3. In Amped, go to the step that captures phone numbers and open the Button Actions for the CTA.

4. Click on "Add Action" and then select "Custom Code."
​

‍

5. In the code editor, give the action a name (such as "Send to Emotive") and paste in the following code, replacing the API Key with the key you copied from Emotive:
​

// Start Custom code here
function convertTo10DigitFormat(input) {
var res = input.replace(/^\+1/, '').replace(/^001/, '').replace(/[^0-9]/g, '');
// 11 digits, leading with 1 - remove the leading 1
if (res.length === 11 && res.match(/^1/)) {
res = res.replace(/^1/, '');
}
return res;
}
var data = {
api_key: 'REPLACE_WITH_YOUR_EMOTIVE_API_KEY', // The API Key from Emotive
keyword: 'JOIN',
cell_number: convertTo10DigitFormat(input.phone_number)
}

var queryString = Object.entries(data)
.map((d) => (`${d[0]}=${encodeURIComponent(d[1])}`))
.join('&')

fetch("https://www.emotiveapp.co/api/opt_in_user", {
body: queryString,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
method: "post",
})

// resolve(); tells your ad to continue. Othwerwise the ad will load indefinitely, break, and it will timeout.
resolve();

6. Save the code and preview the popup live to confirm that everything is working as expected. You should see the Reply Y text and the phone number should be sent to Emotive.


Picking the Right Template

For the best results when integrating Emotive with Amped, we recommend using the phone input field for all device types and not using Tap to Text. With Emotive, subscribers will need to reply Y to a confirmation text that is sent as soon as they sign up. Here's how to choose the right template:

1. Find a template you want to use and click on "Build your own" to customize it.
​

Build your own version of a Template in Amped

2. Select "Email + SMS Capture" for How would you like to use this template?
​

Pick Email and SMS Capture


3. Choose "Reply Y required for full consent" for What type of SMS consent do you need?
​


4. Select "Phone input field" for Which SMS Opt-in method would you like?
​


5. Then customize the template to fit your needs, follow the steps above to add in the Emotive Integration, and you're all set!
​

Troubleshooting

If you are having issues with the integration, try the following:

  • Make sure you have copied the correct API Key from Emotive and pasted it into the code in Amped.

  • Confirm that you have selected the right template in Amped and are using the Phone Input Field and Reply Y option.

  • Preview the popup live to ensure everything is working as expected.

  • If you are still experiencing issues, reach out to the Amped support team at [email protected] for assistance.

Did this answer your question?