Send Privy Sign-Ups to Sailthru

Use a custom code snippet to automatically share the sign-up information captured by your Privy displays with your Sailthru account.

Note: The Privy Support Team is unable to assist with a custom implementation of this code. Before making any changes, please consult the Sailthru JS API documentation carefully and consider connecting with your Sailthru representative or developer. 

Considerations

The capabilities of the default User Sign-up code are:

  • The function will add a Privy contact to Sailthru by email address. The contact's first and last names are also provided but do not factor into the deduplication process. 
  • The function will update an existing Sailthru user profile if the email address already exists as a user profile key. This deduplication will prevent unnecessary copies of the same user.
  • The function will add the Privy contact to the Sailthru account's master list. 

Additional fields, list memberships, user var data, and an acquisition source are available by customizing the code. Refer to the Sailthru JS API documentation for this type of customization.

Warning: The script uses Sailthru's userSignUp method. This method may sync recent page views recorded to a cookie while visitors are browsing anonymously. To remain in compliance with GDPR or other regulations, you may need to take action to prevent the extra browsing data from being synced. Please consult the GDPR Note in the userSignUp section of the Sailthru JS API documentation for more information.

Configuration

To add the User Sign-up code to Privy and ensure it will function correctly:

  • Confirm that your Sailthru JS tag appears on all of the pages where your Privy sign-up forms are triggered. Check out the verification process for the Privy code if you need a refresher on locating tags within your site content.
  • Visit the Customizations page in your Privy account.
  • Enter the code listed below into the Conversion Pixels box; ensuring you've replaced the placeholder var stLists , var stFirstNameVar , and var stLastNameVar values. 
<!-- BEGIN SAILTHRU USER SIGN-UP CODE -->
<script> var stLists = { "<ENTER DESIRED LIST NAME HERE>": 1 }; var stFirstNameVar = "<ENTER FIRST NAME VARIABLE NAME HERE>"; var stLastNameVar = "<ENTER LAST NAME VARIABLE NAME HERE>"; var stEmail = "{{ contact.email }}"; var stEmailOptIn = "{{ contact.custom_fields.confirm_opt_in }}" === "true"; var stFirstName = "{{ contact.first_name }}"; var stLastName = "{{ contact.last_name }}"; var stVars = {}; if (stFirstName.length > 0) stVars[stFirstNameVar] = stFirstName; if (stLastName.length > 0) stVars[stLastNameVar] = stLastName; if (stEmail.length > 0 && stEmailOptIn) { var stReq = { "email" : stEmail, "lists" : stLists, "vars" : stVars, "onSuccess" : function() { console.log("Sailthru sign up"); }, "onError" : function() { console.log("Sailthru JS error occurred"); } }; Sailthru.integration("userSignUp", stReq); } </script>
<!-- END SAILTHRU USER SIGN-UP CODE -->

Warning: The script does not sync blank/empty fields. Additionally, it only syncs when contact.email is present and contact.custom_fields.confirm_opt_in is set to a 'true' value. 

  • Click the Save button. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us