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:
Copy the code below
Navigate to the SMS Capture Step on your campaign > Primary CTA > Button Actions
Add "Custom Code" button action
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! πͺ
β