Skip to main content
OneText
Maggie Buchanan avatar
Written by Maggie Buchanan
Updated over 5 months ago

Introduction

This guide will walk you through the steps to integrate Amped.io with OneText.

OneText and Amped work seamlessly together by adding some code onto the SMS capture CTA to send straight to the OneText SDK.

Implementing OneText Code on SMS Capture:

  1. Copy the code below

  2. Navigate to the SMS Capture Step on your campaign > Primary CTA > Button Actions

  3. Add "Custom Code" button action

  4. Paste code in, title it & save!

Note: Make sure your custom code action is setup on top of the action to send users to the next step. Simply click and drag to re-order if needed!

πŸ“± OneText code to copy + paste in Amped


/////////////////////////////////////////////
// πŸ“² Send new phone numbers to OneText SDK client side with email and phone
/////////////////////////////////////////////
if (typeof window.onetext !== 'undefined' &&// Ensure 'onetext' is defined
input.phone_number &&
input.email) {
try {

onetext.optin.submit({
email: input.email,
phone: input.phone_number,
})

} catch (error) {
// Handle any errors that occur during the function call
console.error('Error starting OneText flow:', error);
}
} else {
// Log a different warning based on the specific condition that is not met
if (typeof window.onetext === 'undefined' || !window.onetext.flow || !window.onetext.flow.core || !window.onetext.flow.core.start) {
console.warn('OneText is not available on this page.');
} else if (!input.phone_number) {
console.warn('Phone number is not provided.');
} else if (!input.email) {
console.warn('Email is not provided.');
}
}

resolve();

Test and Publish!
​

Use the "Preview" feature in Amped to test this before going live and then don't forget to publish.

‍

If you have any issues at all, please do not hesitate to reach out to [email protected] and we will help you get this perfect! πŸ’ͺ


​

Did this answer your question?