The Privy integration with Retention Rocket allows the Email Address, First Name, Last Name, and Phone Number of a contact collected by Privy campaigns to be used for SMS marketing in Retention Rocket. The combination provides an opportunity to expand your brand's reach beyond the traditional email channel and meet your customers with compelling promotions in other areas.
Configuration
Compatible campaigns must be created, and a custom script must be added to your account settings before contact information collected via Privy can be shared to Retention Rocket.
Create compatible campaigns
The first thing you will need to do is create a Form Builder campaign in your Retention Rocket admin. After saving the campaign defaults, note the resulting Shop ID and Campaign ID at the bottom of the campaign page. In the example below, the Shop ID is 4, and the Campaign ID is 16.
Next, you need to set up a campaign in Privy. To create the campaign:
- Navigate to Convert and select or create a new campaign that includes a form.
- In the Create step of the campaign builder, edit the form and ensure that the Phone number and Text Opt-In fields are included. If not, use the Add Field dropdown menu to add and Save them. Feel free to keep or add the Email and Name fields if you would like to pass along that information as well.
- Next, it's recommended that you expand the default disclaimer for the campaign to also be applicable to SMS messaging. A common addition is something like, "A text opt-in indicates that I agree to receive recurring automated text messages at the phone number provided. Consent is not a condition to purchase. Msg & data rates may apply. Click to view our Terms of Service."
- After finalizing the design of your display, click Save in the upper right.
- Finish customizing the campaign's settings and click Publish in the upper right.
Add the custom script
To enable the Privy - Retention Rocket connection:
- Navigate to Account > Business Settings.
- In the sidebar, select Customizations under the Business Settings header.
- Next, paste the code provided below into the Conversion Pixels field, scroll down, and Save.
Note: You need to input the Shop ID and Campaign ID that you created in the Create compatible campaigns section of this guide into the bolded areas of the script below (e.g., shop_id = '4';).
Warning: The integration does not sync blank/empty fields and does not sync any information associated with a contact's campaign signup if contact.phone_number is blank/empty.
<script>
var rrPayload = {
shop_id: '<Your Retention Rocket Shop ID>',
campaign_id: '<Your Retention Rocket Campaign ID>',
phone_number: '{{contact.phone_number}}',
sms_optin: '{{contact.custom_fields.sms_opt_in}}' === 'true' };
var rrEmail = '{{contact.email}}';
if (rrEmail.length > 0) rrPayload.email = rrEmail;
var rrFirstName = '{{contact.first_name}}';
if (rrFirstName.length > 0) rrPayload.first_name = rrFirstName;
var rrLastName = '{{contact.last_name}}';
if (rrLastName.length > 0) rrPayload.last_name = rrLastName;
if (rrPayload.phone_number.length > 0) { var rrXhr = new XMLHttpRequest(); rrXhr.open('POST', 'https://api-prod.retentionrock.com/rocketsdk/form_submit.json'); rrXhr.setRequestHeader('Content-Type', 'application/json'); rrXhr.onload = function() { if (rrXhr.status === 200) { console.log('Retention Rocket ' + rrXhr.responseText); } else if (rrXhr.status !== 200) { console.log('Retention Rocket request failed. ' + rrXhr.status); } };
rrXhr.send(JSON.stringify(rrPayload)); }
</script>
Test the connection
After following the steps outlined above, you should be all set to pass contact information from your Privy campaigns to your Retention Rocket account. More specifically, all of your Privy campaigns should be connected to the Retention Rocket form builder campaign.
You can test this connection by submitting a Privy campaign on your website. You should then receive an SMS confirmation from Retention Rocket if that setting is enabled on your Retention Rocket form campaign.