Squarespace API Integration

With Squarespace API Integration you can forward leads into your aNinja account simply using a programming code or an API. In this article, we show you how the Squarespace API Integration can be done.

Squarespace API Integration

The following example is specific to Squarespace (add in the “Page section Settings > Advanced tab > Page header code injection text area section for the page where you have the form you want to forward into aNinja).

// SQUARESPACE - example 1
// Add in javascript advanced:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('form').submit(function(e) {
var contact_name = $("input[name='fname']").val();
var contact_email1 = $( "input[name='email']").val();
var phone_areacode = $('*[data-title="Areacode"]').val();
var phone_prefix= $('*[data-title="Prefix"]').val();
var phone_line = $('*[data-title="Line"]').val();
var contact_phone1 = phone_areacode+phone_prefix+phone_line;
var subject = $($('select')[0]).val();
var pref_contact_method = $($('select')[1]).val();
var message = $('textarea#textarea-yui_3_17_2_1_1442700176413_134868-field').val();

$.ajax({
type: 'post',
url: "https://aninja.com/api/v1/contactform/?apikey=YOUR_API_KEY_HERE",
data: {
'contact_name': contact_name,
'contact_email1': contact_email1,
'contact_phone1': contact_phone1,
'your-comments': 'message: '+message+' subject:'+subject+' pref_contact_method: '+pref_contact_method
},
success: function (data) {
// alert('success');
}
});
});
});
</script>

Fields mapping Table

The following are standard fields you can map to, in addition to any custom fields created in your application that you can see under Settings > Custom fields.

Where does the imported data appear?

After the integration, you can search your aNinja CRM for the imported leads. You can also search for any custom field, opportunities, and any other info that you have imported.

  • Lead’s contacts appear in the leads contact section in the lead view
  • Opportunities also appear in the opportunity section in the lead view
  • The company’s info appears on the top left of the lead view, in the Company section.
  • Custom fields appear in the custom field section of the lead view
  • Lead Search is a field that also appears in the bottom left of the lead view. Specifically, these are info/links on the lead or the organization found in Google search.

Need help with Squarespace API Integration? Leave us an email at support@aninja.com. And we will happily assist you.