Failed leads API injection

The “Failed Leads API injection” feature allows you to track leads that were not successfully injected into your CRM.

When a lead is rejected, the system automatically generates an entry in the logs; it provides detailed information about the failed injection; and includes the reason why the injection failed.

Why does leads injection fails

There are multiple reasons for a lead coming via API to fail being injected in aNinja. Here are the reasons that we log in Settings > logs. Leads injection could fail due to:

  • Duplicate Emails
  • Missing required fields (contact_name)
Failed leads API injection due to duplicate Emails

In Settings > Global Settings, if the following rule is enabled,

“Do not add new Leads via api if Lead with similar email already exists (avoids duplicates)”

when a lead is added via API, the system first checks if the lead already exists in the CRM.

It compares the email address of the new lead with the existing leads in the system.

If the system identifies an existing lead with a similar email address, it does not add the new lead to avoid duplication. Subsequently, it generates an entry in Logs, providing the reason of the failed lead injection.

Failed lead API injection due to missing required field

The contact name is the only required field for a successful lead creation. And the system creates the lead in reference to the contact name and saves the lead data.

If the lead data coming through API is missing the contact name, it does not create a new lead; and it generates an entry in Logs with the reason of failed lead injection.

Accessing the Failed leads API injection Logs

  • Click on “Failed leads API injection” from the toolbar

Failed leads API injection due to duplicate emailsIn this table, you can view:

  • ID: A sequential number
  • Reason: The reason for which the lead failed to inject
  • Data: The source of the lead that failed to inject
  • Created: The date & time this record was created – failed to inject.

By providing clear and detailed information about rejected leads, you can quickly identify the failed leads injection and address the issue.

Godaddy API Form integration

With the simple Javascript code, you can forward your web form leads into your aNinja account. In this article, we show you how the Godaddy API Form integration can be done.

Godaddy API Form integration

The following example is specific to GodDaddy websites.

  • First, log in to your GoDaddy account
  • Then, go to the Product page.
  • Scroll down to Websites + Marketing
  • And, select Manage next to your website to open your site.
  • Select Edit Website or Edit Site to open your website builder.
  • Then, select the form page.
  • Here, you want to search for the HTML section and select Add.
  • Click Embed custom code on the page.

User-added image

  • Click inside the new section to open up the HTML editor.

User-added image

  • Here, in the “Custom Code” box, paste the Javascript code in the following example.
    • You want to replace the fields names used in the example with your form fields names.
    • Also, check the fields mapping table section to map your form fields to aNinja’s.

Example:

<script src = “https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script>
<script>
$(document).ready(function () {

window.parent.submitted = false;
$(window.parent.document).on(‘submit’, ‘[data-aid=”CONTACT_FORM_CONTAINER_REND“] form’, function (e) {
// Avoid mutliple submissions during 5 seconds period to avoid duplicates
if (window.parent.submitted) {
return;
}
window.parent.submitted = true;
setTimeout(() => {
window.parent.submitted = false;
}, ‘5000’);

let contact_name = ”;
if ($(‘input[data-aid=”CONTACT_FORM_NAME“]’, window.parent.document)) {
contact_name = $(‘input[data-aid=”CONTACT_FORM_NAME“]’, window.parent.document).val();
}
let contact_email1 = ”;
if ($(‘input[data-aid=”CONTACT_FORM_EMAIL“]’, window.parent.document)) {
contact_email1 = $(‘input[data-aid=”CONTACT_FORM_EMAIL“]’, window.parent.document).val();
}
let contact_phone1 = ”;
if ($(‘input[data-aid=”CONTACT_FORM_PHONE“]’, window.parent.document)) {
contact_phone1 = $(‘input[data-aid=”CONTACT_FORM_PHONE“]’, window.parent.document).val();
}
let address_street1 = ”;
if ($(‘input[data-aid=”Address (Street, City, Zip Code)”]’, window.parent.document)) {
address_street1 = $(‘input[data-aid=”Address (Street, City, Zip Code)”]’, window.parent.document).val();
}
let custom_message = ”;
if ($(‘textarea[data-aid=”CONTACT_FORM_MESSAGE“]’, window.parent.document)) {
custom_message = $(‘textarea[data-aid=”CONTACT_FORM_MESSAGE“]’, window.parent.document).val();
}

// Ajax call
$.ajax({
type: ‘POST’,
url: “https://aninja.com/api/v1/contactform/?apikey=<YOUR_APIKEY>“,
data: $.param({contact_name : contact_name}) + “&”+ $.param({contact_email1 : contact_email1}) + “&”+ $.param({contact_phone1 : contact_phone1}) + “&”+ $.param({address_street1 : address_street1})+ “&”+ $.param({custom_message : custom_message}),
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.

For the 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 Godaddy API Form integration? Leave us an email at support@aninja.com. And we will happily assist you.

aNinja Trigger Events

aNinja trigger events is a specific incident, when verified, triggers the execution of one or multiple actions.

aNinja trigger events include:

“Custom Field Value Changed”, “Incoming Calls”, “Incoming SMS or Email”, “Lead creation”, “Outgoing SMS with error code”, and “Workflow step status changed”.

aNinja Trigger Events

You can access the Trigger Events from the left sidebar > Automations > Triggers > Add trigger.

aNinja Trigger eventsTrigger Events
  • Custom Field Value Changed
    • Indicate the custom field value that when changed in the lead view, fires the trigger action.
  • Incoming Call
    • Specify the call type: missed call, busy, or completed.

  • Incoming Email or SMS
    • When you receive an Email or Text from outside aNinja.
    • Add a specific body content for the incoming Texts to be identified by the system.
  • Lead Created via API
    • Leads coming through API are the result of aNinja integrations (e.g. Forms, Ads, etc…).
  • Lead Created via Chatbot
    • Leads coming through Chatbot are the result of Chatbot conversations.
  • Outgoing SMS with error code
    • If the phone number saved in the lead contacts is wrong, landline, or blocked by the carrier, your sent SMS will return with an error code that we log for each call.

  • Workflow step status changed

 

 

Trigger “Duplicate Leads Merge” action

Trigger “Duplicate Leads Merge” action is useful when leads created via API create duplicates in your account;  you can then automatically merge them through Triggers.

Definitely, you want to keep a clean and consolidated data. This allows you to generate more accurate and meaningful reports and analytics, which can help in making informed business decisions.

Setting the Trigger “duplicate leads merge action”

Trigger actions get executed based on a certain event that you specify in the triggers feature:

  • Select the event that will cause the trigger to fire.
    • e.g. Lead created via API

  • Under Actions, click “+ add another action”
  • Select from the actions drop-down:

[Lead merge] Merge new lead into existing duplicate

Trigger duplicate leads merge action

  • And indicate the merge method (email/phone).

  • This automatically merges new leads by ‘phone’ or ’email’ if ‘Lead created via API’ option was selected as the desired event.

Good to know:

If a lead with the same email was sent via API but doesn’t appear in aNinja, you should check if the “Do not add new leads via API if lead with similar email already exists” rule is disabled. This rule prevents duplicate leads from being created, and therefore, the merging logic will not take effect.

  • You can also indicate if this action should stop executing all subsequent actions/triggers in case the new lead has been merged. This is helpful if you don’t want a specific sequence to fire off for already existing leads.

  • With that being said, it would be better if you set the trigger using this action with a high priority number so that it gets fired first.

aNinja Activities Logs

It’s important to have a clear understanding of all the activities and interactions that occur on your aNinja account. aNinja provides a helpful solution in the form of activity logs reports, allowing you to conduct audits whenever necessary.

Specifically, the logs report feature provides a comprehensive overview of all incoming and outgoing calls, emails, and texts, and the triggers you’ve launched. Additionally, you can easily view the failed leads API injection.

Accessing aNinja Activities Logs reports

Activities Logs

  • Calls
    • You can see the details of the incoming and outgoing calls, including the lead ID, duration and date of the calls.
    • You can also listen to the recordings of the conversations.
  • Emails
    • Here are saved all the details on the incoming and outgoing emails, including the sequences and their statuses.
  • Texts
    • You can see the details of the incoming and outgoing texts, including the sequences and their statuses.
  • Audit Log
    • As an admin user, this option allows you to see the activity of the users in searching for leads using smartlists or from the top navigation bar, and the lead view that the users opened.
  • Failed leads API injection
    • You can identify any leads that failed to import into your aNinja account via API for duplicate emails.